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 ea694812
authored
Oct 01, 2012
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made jshint happy
1 parent
80a004eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
lib/dao.js
lib/dialects/mysql/query.js
lib/dao.js
View file @
ea69481
var
Utils
=
require
(
"./utils"
)
var
Utils
=
require
(
"./utils"
)
,
Mixin
=
require
(
"./associations/mixin"
)
,
Mixin
=
require
(
"./associations/mixin"
)
,
DataTypes
=
require
(
"./data-types"
)
,
Validator
=
require
(
"validator"
)
,
Validator
=
require
(
"validator"
)
module
.
exports
=
(
function
()
{
module
.
exports
=
(
function
()
{
var
DAO
=
function
(
values
,
options
)
{
var
DAO
=
function
(
values
,
options
)
{
var
self
=
this
this
.
attributes
=
[]
this
.
attributes
=
[]
this
.
validators
=
{}
// holds validation settings for each attribute
this
.
validators
=
{}
// holds validation settings for each attribute
this
.
__factory
=
null
// will be set in DAO.build
this
.
__factory
=
null
// will be set in DAO.build
...
@@ -32,7 +29,7 @@ module.exports = (function() {
...
@@ -32,7 +29,7 @@ module.exports = (function() {
Object
.
defineProperty
(
DAO
.
prototype
,
'isDeleted'
,
{
Object
.
defineProperty
(
DAO
.
prototype
,
'isDeleted'
,
{
get
:
function
()
{
get
:
function
()
{
var
result
=
this
.
__options
.
timestamps
&&
this
.
__options
.
paranoid
var
result
=
this
.
__options
.
timestamps
&&
this
.
__options
.
paranoid
result
=
result
&&
this
[
this
.
__options
.
underscored
?
'deleted_at'
:
'deletedAt'
]
!=
null
result
=
result
&&
this
[
this
.
__options
.
underscored
?
'deleted_at'
:
'deletedAt'
]
!=
=
null
return
result
return
result
}
}
...
...
lib/dialects/mysql/query.js
View file @
ea69481
...
@@ -65,11 +65,11 @@ module.exports = (function() {
...
@@ -65,11 +65,11 @@ module.exports = (function() {
,
self
=
this
,
self
=
this
// add the inserted row id to the instance
// add the inserted row id to the instance
if
(
this
.
callee
&&
(
this
.
sql
.
indexOf
(
'INSERT INTO'
)
==
0
)
&&
(
results
.
hasOwnProperty
(
'insertId'
)))
{
if
(
this
.
callee
&&
(
this
.
sql
.
indexOf
(
'INSERT INTO'
)
==
=
0
)
&&
(
results
.
hasOwnProperty
(
'insertId'
)))
{
this
.
callee
[
this
.
callee
.
__factory
.
autoIncrementField
]
=
results
.
insertId
this
.
callee
[
this
.
callee
.
__factory
.
autoIncrementField
]
=
results
.
insertId
}
}
if
(
this
.
sql
.
indexOf
(
'SELECT'
)
==
0
)
{
if
(
this
.
sql
.
indexOf
(
'SELECT'
)
==
=
0
)
{
// transform results into real model instances
// transform results into real model instances
// return the first real model instance if options.plain is set (e.g. Model.find)
// return the first real model instance if options.plain is set (e.g. Model.find)
if
(
this
.
options
.
raw
)
{
if
(
this
.
options
.
raw
)
{
...
...
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