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:

test/functional/api/v2/fact_values_controller_test.rb
get :index, {:host_id => @host.name }
assert_response :success
fact_values = ActiveSupport::JSON.decode(@response.body)['results']
expected_hash = FactValue.build_facts_hash(FactValue.find_all_by_host_id(@host.id))
expected_hash = FactValue.build_facts_hash(FactValue.where(:host_id => @host.id))
assert_equal expected_hash, fact_values
end
......
get :index, {:host_id => @host.id }
assert_response :success
fact_values = ActiveSupport::JSON.decode(@response.body)['results']
expected_hash = FactValue.build_facts_hash(FactValue.find_all_by_host_id(@host.id))
expected_hash = FactValue.build_facts_hash(FactValue.where(:host_id => @host.id))
assert_equal expected_hash, fact_values
end
end

Also available in: Unified diff