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 2d55a45b
authored
Aug 07, 2010
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed date bug
1 parent
4a61a0d5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
src/Sequelize.js
src/SequelizeTable.js
src/Sequelize.js
View file @
2d55a45
...
...
@@ -87,13 +87,13 @@ Sequelize.prototype = {
table
.
klass
.
prepareAssociations
()
})
if
(
SequelizeHelper
.
Hash
.
keys
(
this
.
tables
).
length
==
0
)
if
(
(
SequelizeHelper
.
Hash
.
keys
(
this
.
tables
).
length
==
0
)
&&
callback
)
callback
()
else
SequelizeHelper
.
Hash
.
forEach
(
tables
,
function
(
table
)
{
table
.
klass
.
sync
(
function
()
{
finished
.
push
(
true
)
if
(
finished
.
length
==
SequelizeHelper
.
Hash
.
keys
(
tables
).
length
)
if
(
(
finished
.
length
==
SequelizeHelper
.
Hash
.
keys
(
tables
).
length
)
&&
callback
)
callback
()
})
})
...
...
@@ -140,7 +140,7 @@ Sequelize.prototype = {
SequelizeHelper
.
log
(
"Executing the query: "
+
queryString
)
connection
.
execute
(
queryString
)
.
query
(
queryString
)
.
addListener
(
'row'
,
function
(
r
){
values
.
push
(
r
)
})
.
addListener
(
'field'
,
function
(
f
){
fields
.
push
(
f
)})
.
addListener
(
'end'
,
function
()
{
...
...
@@ -152,7 +152,7 @@ Sequelize.prototype = {
mapping
[
fields
[
i
].
name
]
=
valueArray
[
i
]
result
.
push
(
mapping
)
})
callback
(
result
)
if
(
callback
)
callback
(
result
)
}
})
connection
.
close
()
...
...
src/SequelizeTable.js
View file @
2d55a45
...
...
@@ -80,7 +80,6 @@ SequelizeTable = function(sequelize, tableName, attributes) {
)
},
// TODO: mysql library currently doesn't support MYSQL_DATE!!! look for fix
findAll
:
function
(
options
,
callback
)
{
// use the first param as callback if it is no object (hash)
var
_callback
=
(
typeof
options
==
'object'
)
?
callback
:
options
...
...
@@ -111,11 +110,10 @@ SequelizeTable = function(sequelize, tableName, attributes) {
)
},
// TODO: mysql library currently doesn't support MYSQL_DATE!!! don't merge if fixed
sqlResultToObject
:
function
(
result
)
{
if
(
typeof
result
==
undefined
)
return
null
var
object
=
new
table
(
SequelizeHelper
.
Hash
.
merge
({
createdAt
:
new
Date
(),
updatedAt
:
new
Date
()},
result
,
true
)
)
var
object
=
new
table
(
result
)
object
.
id
=
result
.
id
return
object
},
...
...
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