Skip to content

Commit a689605

Browse files
author
Vlad Balin
committed
Rolled back mixins fix. Doesn't work.
1 parent c5bcfd7 commit a689605

File tree

4 files changed

+5
-14
lines changed

4 files changed

+5
-14
lines changed

index.js

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/record/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ Record.define = function( protoProps : RecordDefinition = {}, staticProps ){
1717
// Extract record definition from static members, if any.
1818
staticsDefinition : RecordDefinition = tools.getChangedStatics( this, 'attributes', 'collection', 'Collection' ),
1919
// Definition can be made either through statics or define argument.
20-
// Merge them together, so we won't care about it below.
21-
// Grab an object's prototype values so mixins will be merged properly.
22-
definition = defaults( staticsDefinition, protoProps, this.prototype );
20+
// Merge them together, so we won't care about it below.
21+
definition = assign( staticsDefinition, protoProps );
2322

2423
if( 'Collection' in this && this.Collection === void 0 ){
2524
tools.log.error( `[Model Definition] ${ this.prototype.getClassName() }.Collection is undefined. It must be defined _before_ the model.`, definition );

src/record/transaction.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* The root of all definitions.
44
*/
55

6-
import { tools, eventsApi, Mixable, ClassDefinition, Constructor, define, mixinRules } from '../object-plus'
6+
import { tools, eventsApi, Mixable, ClassDefinition, Constructor, define } from '../object-plus'
77

88
import { transactionApi, CloneOptions, Transactional, Transaction, TransactionOptions, Owner } from '../transactions'
99
import { ChildrenErrors } from '../validation'
@@ -107,10 +107,6 @@ let _cidCounter : number = 0;
107107
idAttribute : 'id',
108108
_keys : [ 'id' ]
109109
})
110-
@mixinRules({
111-
attributes : 'merge',
112-
defaults : 'merge'
113-
})
114110
export class Record extends Transactional implements Owner {
115111
// Implemented at the index.ts to avoid circular dependency. Here we have just proper singature.
116112
static define( protoProps : RecordDefinition, staticProps? ) : typeof Record {

0 commit comments

Comments
 (0)