[PATCH conductor] Fix ApplicationController#ids_list

Imre Farkas ifarkas at redhat.com
Fri Jun 22 10:50:58 UTC 2012


On 06/22/2012 10:04 AM, Jan Provazník wrote:
> On 06/14/2012 10:32 AM, ifarkas at redhat.com wrote:
>> From: Imre Farkas<ifarkas at redhat.com>
>>
>> The String#each method does not exist in Ruby 1.9
>> ---
>>   src/app/controllers/application_controller.rb |    9 +++++----
>>   1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/app/controllers/application_controller.rb
>> b/src/app/controllers/application_controller.rb
>> index aed6b7e..a090a17 100644
>> --- a/src/app/controllers/application_controller.rb
>> +++ b/src/app/controllers/application_controller.rb
>> @@ -117,10 +117,11 @@ class ApplicationController<
>> ActionController::Base
>>
>>     # Returns an array of ids from params[:id], params[:ids].
>>     def ids_list(other_attrs=[])
>> -    other_attrs.each do |attr_key|
>> -      return Array(params[attr_key]) if params.include?(attr_key)
>> -    end
>> -    if params[:id].present?
>> +    if other_attrs.is_a?(Enumerable)
>> +      other_attrs.each do |attr_key|
>> +        return Array(params[attr_key]) if params.include?(attr_key)
>> +      end
>> +    elsif params[:id].present?
>>         return Array(params[:id])
>>       elsif params[:ids].present?
>>         return Array(params[:ids])
>
> ACK

While fixing some specs on Ruby 1.9, it breaks them on Ruby 1.8. Need 
more investigation, so reverted the commit.




More information about the aeolus-devel mailing list