clio / polymorphic_integer_type

MIT License
37 stars 35 forks source link

undefined method merge! for conditions with raw sql #12

Closed jogaco closed 9 years ago

jogaco commented 9 years ago

I have this:

    has_many :other_credits, :class_name => 'Credit', :as => :creditable, integer_type: true, 
                     :conditions => ['credit_role_id NOT IN (?)', [ROLE1, ROLE2, ROLE3]] 

And this is the error when trying to use polymorphic_integer_type:

NoMethodError: undefined method `merge!' for ["credit_role_id NOT IN (?)", [1, 2, 3]]:Array
/home/user/.rvm/gems/ruby-2.1.2@myproject/gems/polymorphic_integer_type-1.0.5/lib/polymorphic_integer_type/extensions.rb:51:in `remove_type_and_establish_mapping'
/home/user/.rvm/gems/ruby-2.1.2@myproject/gems/polymorphic_integer_type-1.0.5/lib/polymorphic_integer_type/extensions.rb:56:in `has_many'