Project

General

Profile

« Previous | Next » 

Revision 890e765e

Added by Daniel Lobato Garcia almost 9 years ago

Fixes #11078 - Substitute find_all_by by where to comply with Rails 4

This commit takes away all instances up to this point of find_all_by to
improve Rails 4 compatibility. They are substituted by .where calls.

View differences:

app/controllers/api/v2/permissions_controller.rb
type = params[:resource_type].blank? ? nil : params[:resource_type]
name = params[:name].blank? ? nil : params[:name]
if type
@permissions = Permission.find_all_by_resource_type(type)
@permissions = Permission.where(:resource_type => type)
elsif name
@permissions = Permission.find_all_by_name(name)
@permissions = Permission.where(:name => name)
else
@permissions = Permission.all
end

Also available in: Unified diff