Skip to content

Releases: mbroersen/jeloquent

Adds original values

17 Feb 19:04
a53ba5b
Compare
Choose a tag to compare
User.insert({id: 1, name: 'Hello Mister'});

const user = User.find(1);
user.name = 'Hello Mister 1';
user.name = 'Hello Mister 2';

user.originalValues
// returns 
{id: 1, name: 'Hello Mister'}

Adds delete statement to model instance

09 Feb 21:29
e3ba0ae
Compare
Choose a tag to compare

Refactors index management

Adds delete statement

User.delete(1);
User.find(1).delete();

Fixes hasMany relations with a temporary key

06 Feb 18:00
e2dca72
Compare
Choose a tag to compare
Merge pull request #46 from mbroersen/develop

Release 2.8.2

Use sets for the index relation lists

04 Feb 07:30
1b7e673
Compare
Choose a tag to compare
Merge pull request #45 from mbroersen/develop

Release 2.8.1

Use maps for indexes

03 Feb 19:08
d8dc8b5
Compare
Choose a tag to compare
Merge pull request #44 from mbroersen/develop

Release 2.8.0

use globalThis

29 Jan 17:42
8a1b243
Compare
Choose a tag to compare

Adds Webpack5

Fixes nullable polymorphic relations

11 Dec 21:33
75dc13f
Compare
Choose a tag to compare
Merge pull request #39 from mbroersen/develop

fix nullable polymorphic relations

Fixes isDirty when previous value is null and new value is not

08 Dec 18:59
4ce2725
Compare
Choose a tag to compare
Merge pull request #38 from mbroersen/develop

fixes isDirty on null values

Add renaming of belongsTo relation

02 Dec 16:16
86415cb
Compare
Choose a tag to compare
  • Add renaming of belongsTo relation
export default class TwoPersonTeam extends Model{

    constructor() {

        const fields = [
            new Field('id', true),
            new BelongsTo(User, 'user_one_id', 'user_one'), 
            new BelongsTo(User, 'user_two_id', 'user_two'), 
        ]

        super(fields);
    }
}

TwoPersonTeam.insert({id: 1, user_one_id: 20, user_two_id});
TwoPersonTeam.find(1).user_one // returns User 20
TwoPersonTeam.find(1).user_two // returns User 50
  • Adds inserting of morphTo field through model
Avatar.insert({
  my_parent: [
    {avatar_id: 9190, avatar_type: 'Team', name: 'AvatarInsertedTeam'},
    {avatar_id: 2901, avatar_type: 'User', name: 'AvatarInsertedUser', team_id: 9190},
  ]
});

Updates foreign_key indexes on save

13 Nov 22:16
2d882e4
Compare
Choose a tag to compare
  • Adds is dirty
User.find(1);
User.name = 'new name';
User.isDirty() // returns true;
User.isDirty('name') // returns true;