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 bd1279d3
authored
Sep 22, 2010
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
methods for checking for stored associations + getter and setter
1 parent
82120c5d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
lib/sequelize/SequelizeTable.js
lib/sequelize/SequelizeTable.js
View file @
bd1279d
...
@@ -105,7 +105,7 @@ exports.SequelizeTable = function(Sequelize, sequelize, tableName, attributes, o
...
@@ -105,7 +105,7 @@ exports.SequelizeTable = function(Sequelize, sequelize, tableName, attributes, o
findAll
:
function
(
options
,
callback
)
{
findAll
:
function
(
options
,
callback
)
{
// use the first param as callback if it is no object (hash)
// use the first param as callback if it is no object (hash)
var
_callback
=
(
typeof
options
==
'object'
)
?
callback
:
options
var
_callback
=
(
(
typeof
options
==
'function'
)
?
options
:
callback
)
var
queryOptions
=
(
typeof
options
==
'object'
)
var
queryOptions
=
(
typeof
options
==
'object'
)
?
Sequelize
.
Helper
.
Hash
.
merge
(
options
,
{
table
:
table
.
tableName
})
?
Sequelize
.
Helper
.
Hash
.
merge
(
options
,
{
table
:
table
.
tableName
})
:
{
table
:
table
.
tableName
}
:
{
table
:
table
.
tableName
}
...
@@ -129,7 +129,7 @@ exports.SequelizeTable = function(Sequelize, sequelize, tableName, attributes, o
...
@@ -129,7 +129,7 @@ exports.SequelizeTable = function(Sequelize, sequelize, tableName, attributes, o
find
:
function
(
conditions
,
options
,
callback
)
{
find
:
function
(
conditions
,
options
,
callback
)
{
// use the second param as callback if it is no object (hash)
// use the second param as callback if it is no object (hash)
var
_callback
=
(
typeof
options
==
'object'
)
?
callback
:
options
var
_callback
=
(
(
typeof
options
==
'object'
)
?
callback
:
options
)
sequelize
.
query
(
sequelize
.
query
(
Sequelize
.
sqlQueryFor
(
'select'
,
{
Sequelize
.
sqlQueryFor
(
'select'
,
{
...
@@ -325,7 +325,15 @@ exports.SequelizeTable = function(Sequelize, sequelize, tableName, attributes, o
...
@@ -325,7 +325,15 @@ exports.SequelizeTable = function(Sequelize, sequelize, tableName, attributes, o
},
},
hasFetchedAssociationFor
:
function
(
assocName
)
{
hasFetchedAssociationFor
:
function
(
assocName
)
{
return
this
.
fetchedAssociations
&&
this
.
fetchedAssociations
[
assocName
]
return
(
this
.
fetchedAssociations
&&
this
.
fetchedAssociations
[
assocName
])
},
setAssociationDataFor
:
function
(
assocName
,
data
)
{
this
.
fetchedAssociations
[
assocName
]
=
data
},
getAssociationDataFor
:
function
(
assocName
)
{
return
this
.
fetchedAssociations
[
assocName
]
},
},
save
:
function
(
callback
)
{
save
:
function
(
callback
)
{
...
...
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