callebedrums / sea

Sea - AngularJS REST/ORM framework
MIT License
11 stars 1 forks source link

SEA to be my new ORM of choice #1

Open adyba opened 9 years ago

adyba commented 9 years ago

I like the code!!! I have seen several ng-ORM's already and this one has the cleanest code-base ever. I have some minor objectives that would prevent me from using this on my projects. Basically those are not big changes in terms of logic or core of the code, but can make huge difference in terms of usability.

callebedrums commented 9 years ago

Hi adyba.

Nice that you have liked my code.

Be free to fork, make changes and submit a pull request. I will be glad with your contribution.

Thanks for the feedback. I will try to improve SEA with your tips. When I do it, I will let you know.

adyba commented 9 years ago

I don't really understand the mechanism of configuration SEA from outside via defSettings, but I can still monkey-patch it ;) I'll do my best to create something like defSettings.masterKey and to convince SEA to use its value instead of simple id

callebedrums commented 9 years ago

Hi again.

I have created a branch, called iss1.

It has some changes to suport the masterKey configuration.

You can configure it using provider:

dashboard.config(function ($seaModelProvider) {
    $seaModelProvider.settings({
        masterKey: 'my_master_key'
    });
});

Or can set it on a single model:

return $seaModel.newModel({
    name: 'Modelname',
    masterKey: 'my_master_key',
    fields: {...}
});

Each instance will get a 'my_master_key' attribute. 'id' is the default.

I Will keep it on branch until i do enough tests. It is not stable, so if you find some bugs, let me know.

I hope I have helped.

adyba commented 9 years ago

You are damn fast ;)) Looking forward to test it against https://github.com/baugarten/node-restful