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 7d0dbfef
authored
Apr 16, 2011
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
require underscore.string
1 parent
819fe626
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
5 deletions
lib/sequelize/associations/belongs-to.js
test/Model/belongsTo.js
lib/sequelize/associations/belongs-to.js
View file @
7d0dbfe
...
...
@@ -10,13 +10,11 @@ var BelongsTo = module.exports = function(srcModel, targetModel, options) {
// the id is in the source table
BelongsTo
.
prototype
.
injectAttributes
=
function
()
{
var
newAttributes
=
{}
this
.
identifier
=
this
.
target
.
identifierName
console
.
log
(
this
.
identifier
)
newAttributes
[
this
.
identifier
]
=
{
type
:
DataTypes
.
INTEGER
}
console
.
log
(
newAttributes
)
Utils
.
_
.
extend
(
this
.
source
.
attributes
,
Utils
.
simplifyAttributes
(
newAttributes
))
console
.
log
(
'ok'
)
console
.
log
(
this
.
source
)
return
this
}
...
...
test/Model/belongsTo.js
View file @
7d0dbfe
...
...
@@ -17,7 +17,6 @@ module.exports = {
var
Task
=
sequelize
.
define
(
'Task'
+
parseInt
(
Math
.
random
()
*
99999999
),
{
title
:
Sequelize
.
STRING
},
{
underscored
:
true
})
Task
.
belongsTo
(
'user'
,
User
)
console
.
log
(
Task
.
attributes
)
assert
.
eql
(
Task
.
attributes
.
user_id
,
"INT"
)
},
'it should define getter and setter'
:
function
()
{
...
...
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