Comparing version 0.7.3 to 0.7.4
@@ -25,3 +25,3 @@ exports.definition = function(modelName) { | ||
// Normalize WHERE parameter | ||
var where = applyFilter(req.param("sails_filter"), req.param('where') || req.param('search')); | ||
var where = applyFilter(req.param("sails_filter"), req.param('where'), Model); | ||
@@ -35,5 +35,6 @@ // If WHERE is a string, try to interpret it as JSON | ||
var params; | ||
if (!where) { | ||
params = _.extend(req.query || {}, req.params || {}, req.body || {}); | ||
params = applyFilter(req.param("sails_filter"),params); | ||
params = applyFilter(req.param("sails_filter"),params,Model); | ||
@@ -59,3 +60,2 @@ // Remove undefined params | ||
// Respond to queries | ||
@@ -79,3 +79,3 @@ var finding = Model.findAll(options); | ||
var params = _.extend(req.query || {}, req.params || {}, req.body || {}); | ||
params = applyFilter(req.param("sails_filter"),params); | ||
params = applyFilter(req.param("sails_filter"),params, Model); | ||
@@ -107,3 +107,3 @@ Model.create(params).done(function(err, model) { | ||
var params = _.extend(req.query || {}, req.params || {}, req.body || {}); | ||
params = applyFilter(req.param("sails_filter"),params); | ||
params = applyFilter(req.param("sails_filter"),params, Model); | ||
@@ -165,3 +165,3 @@ // Ignore id in params | ||
// (e.g. Mast or Backbone.js) | ||
function applyFilter (sails_filter, data) { | ||
function applyFilter (sails_filter, data, Model) { | ||
if (!data || !_.isObject(data)) return data; | ||
@@ -168,0 +168,0 @@ |
@@ -26,3 +26,3 @@ { | ||
], | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"description": "API-driven framework for building realtime apps, using MVC conventions (based on Express and Socket.io)", | ||
@@ -29,0 +29,0 @@ "homepage": "http://sailsjs.com", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
171855