mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
Merge pull request #1849 from gimelfarb/fix-1801-pg-404
Fixing 404 on page view when using PostgreSQL
This commit is contained in:
commit
28f7a7d12d
1 changed files with 14 additions and 2 deletions
|
@ -58,12 +58,24 @@ ghostBookshelf.Model = ghostBookshelf.Model.extend({
|
|||
return attrs;
|
||||
},
|
||||
|
||||
// Convert bools to ints to be consistent
|
||||
// across db providers
|
||||
fixBools: function (attrs) {
|
||||
_.each(attrs, function (value, key) {
|
||||
if (typeof value === "boolean") {
|
||||
attrs[key] = value ? 1 : 0;
|
||||
}
|
||||
});
|
||||
|
||||
return attrs;
|
||||
},
|
||||
|
||||
format: function (attrs) {
|
||||
return this.fixDates(attrs);
|
||||
return this.fixBools(this.fixDates(attrs));
|
||||
},
|
||||
|
||||
toJSON: function (options) {
|
||||
var attrs = this.fixDates(_.extend({}, this.attributes)),
|
||||
var attrs = this.fixBools(this.fixDates(_.extend({}, this.attributes))),
|
||||
relations = this.relations;
|
||||
|
||||
if (options && options.shallow) {
|
||||
|
|
Loading…
Add table
Reference in a new issue