Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 0fd9d331
authored
Nov 13, 2012
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed if DAO in mixin
1 parent
e564c59d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
13 deletions
lib/associations/mixin.js
lib/dao.js
lib/associations/mixin.js
View file @
0fd9d33
...
@@ -10,10 +10,9 @@ Mixin.hasOne = function(associatedDAO, options) {
...
@@ -10,10 +10,9 @@ Mixin.hasOne = function(associatedDAO, options) {
// the id is in the foreign table
// the id is in the foreign table
var
association
=
new
HasOne
(
this
,
associatedDAO
,
Utils
.
_
.
extend
((
options
||
{}),
this
.
options
))
var
association
=
new
HasOne
(
this
,
associatedDAO
,
Utils
.
_
.
extend
((
options
||
{}),
this
.
options
))
this
.
associations
[
association
.
associationAccessor
]
=
association
.
injectAttributes
()
this
.
associations
[
association
.
associationAccessor
]
=
association
.
injectAttributes
()
if
(
this
.
DAO
)
{
association
.
injectGetter
(
this
.
DAO
.
prototype
);
association
.
injectGetter
(
this
.
DAO
.
prototype
);
association
.
injectSetter
(
this
.
DAO
.
prototype
);
association
.
injectSetter
(
this
.
DAO
.
prototype
);
}
return
this
return
this
}
}
...
@@ -22,10 +21,10 @@ Mixin.belongsTo = function(associatedDAO, options) {
...
@@ -22,10 +21,10 @@ Mixin.belongsTo = function(associatedDAO, options) {
// the id is in this table
// the id is in this table
var
association
=
new
BelongsTo
(
this
,
associatedDAO
,
Utils
.
_
.
extend
((
options
||
{}),
this
.
options
))
var
association
=
new
BelongsTo
(
this
,
associatedDAO
,
Utils
.
_
.
extend
((
options
||
{}),
this
.
options
))
this
.
associations
[
association
.
associationAccessor
]
=
association
.
injectAttributes
()
this
.
associations
[
association
.
associationAccessor
]
=
association
.
injectAttributes
()
if
(
this
.
DAO
)
{
association
.
injectGetter
(
this
.
DAO
.
prototype
);
association
.
injectGetter
(
this
.
DAO
.
prototype
);
association
.
injectSetter
(
this
.
DAO
.
prototype
);
association
.
injectSetter
(
this
.
DAO
.
prototype
);
}
return
this
return
this
}
}
...
@@ -33,10 +32,9 @@ Mixin.hasMany = function(associatedDAO, options) {
...
@@ -33,10 +32,9 @@ Mixin.hasMany = function(associatedDAO, options) {
// the id is in the foreign table or in a connecting table
// the id is in the foreign table or in a connecting table
var
association
=
new
HasMany
(
this
,
associatedDAO
,
Utils
.
_
.
extend
((
options
||
{}),
this
.
options
))
var
association
=
new
HasMany
(
this
,
associatedDAO
,
Utils
.
_
.
extend
((
options
||
{}),
this
.
options
))
this
.
associations
[
association
.
associationAccessor
]
=
association
.
injectAttributes
()
this
.
associations
[
association
.
associationAccessor
]
=
association
.
injectAttributes
()
if
(
this
.
DAO
)
{
association
.
injectGetter
(
this
.
DAO
.
prototype
);
association
.
injectGetter
(
this
.
DAO
.
prototype
);
association
.
injectSetter
(
this
.
DAO
.
prototype
);
association
.
injectSetter
(
this
.
DAO
.
prototype
);
}
return
this
return
this
}
}
...
...
lib/dao.js
View file @
0fd9d33
...
@@ -253,7 +253,6 @@ module.exports = (function() {
...
@@ -253,7 +253,6 @@ module.exports = (function() {
DAO
.
prototype
.
addAttribute
=
function
(
attribute
,
value
)
{
DAO
.
prototype
.
addAttribute
=
function
(
attribute
,
value
)
{
this
[
attribute
]
=
value
this
[
attribute
]
=
value
// this.attributes.push(attribute)
}
}
DAO
.
prototype
.
setValidators
=
function
(
attribute
,
validators
)
{
DAO
.
prototype
.
setValidators
=
function
(
attribute
,
validators
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment