New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use ransack on a field called "item_type" #159
Comments
Which version of Ransack is this happening in? Do you have a test Rails application that I can take a look at and On 3 November 2012 01:05, fernandomm notifications@github.com wrote:
|
I'm having the same issue with Rails 3.2.8, ruby 1.9.3 and Ransack 0.7.0. I'm trying to search id and type fields of a polymorphic model. For instance, the model is called DataError and has an errorable_id and errorable_type field. Attempting to search either of them gets a NameError: uninitialized constant DataError::Errorable |
Do you have a dummy application that reproduces this issue? This would aid On 14 November 2012 02:44, Scott Carleton notifications@github.com wrote:
|
Sure thing. https://github.com/ScotterC/ransack_polymorphic_bug Instructions included in the readme |
I'm having the same issue... Any news on that? |
Same here 👎 Has anyone figured out a solution for this (or at least a workaround)? Thanks |
I had the same issue and I found a WA: remove association from polymorphic model: class Comment < ActiveRecord::Base
# belongs_to :subject, polymorphic: true
end It seems, that error occurs in view layer, I mean that Comment.search(:subject_type_eq => "Article") with uncommented |
I figured out this strange behavior. For example, I have in my form: <%= f.text_field :notable_type_cont %> This line calls Note.search(notable_type_cont: "Article") string So I think when it calls @radar I wrote a fix for that, but I'm not sure if I'm doing right thing. Can you see it? #313 |
Looks like this was the same error I was experiencing over here: #173 (comment) |
related with #159: remove `respond_to?` from Ransack::Search
Hi,
I have a field called item_type on a model called Version. When i try to use this:
It throws an exception:
It works fine for other fields. Any ideas of why this happens?
Thanks.
The text was updated successfully, but these errors were encountered: