Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b09c68a3
authored
Jun 28, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Bug
#446
fixed
parent
e58cd715
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
sails/src/api/models/StuPicto.js
sails/src/api/models/StuPicto.js
View file @
b09c68a3
...
...
@@ -47,6 +47,9 @@ module.exports = {
toJSON
:
function
()
{
var
stuPicto
=
this
.
toObject
();
if
(
typeof
stuPicto
.
attributes
!==
'object'
)
{
stuPicto
.
attributes
=
JSON
.
parse
(
stuPicto
.
attributes
);
}
stuPicto
.
attributes
=
StuPicto
.
getValidAttributes
(
stuPicto
.
attributes
);
return
stuPicto
;
}
...
...
@@ -132,6 +135,9 @@ module.exports = {
* to the function if necesary)
*/
beforeCreate
:
function
(
attrs
,
next
)
{
if
(
typeof
attrs
.
attributes
!==
'object'
)
{
attrs
.
attributes
=
JSON
.
parse
(
attrs
.
attributes
);
}
attrs
.
attributes
=
StuPicto
.
getValidAttributes
(
attrs
.
attributes
);
next
();
},
...
...
@@ -144,6 +150,9 @@ module.exports = {
* to the function if necesary)
*/
beforeUpdate
:
function
(
attrs
,
next
)
{
if
(
typeof
attrs
.
attributes
!==
'object'
)
{
attrs
.
attributes
=
JSON
.
parse
(
attrs
.
attributes
);
}
attrs
.
attributes
=
StuPicto
.
getValidAttributes
(
attrs
.
attributes
);
next
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment