leschenko / elasticsearch_ransack

Search with conditions using predicates such as 'name_cont' or 'created_at_gt' for elasticsearch models
MIT License
18 stars 7 forks source link

undefined method `tire' for class #5

Open mahilock opened 5 years ago

mahilock commented 5 years ago

hi, I just added this gem to my project and tried to execute elastic_ransack on a model but I got below error NoMethodError: undefined method `tire' for # I am using ruby 2.2.6 & rails 4.2 below is the console output

2.2.6 :058 > Complaint.elastic_ransack({text_cont: "ho"}, load: true) NoMethodError: undefined methodtire' for # from /home/mnd/.rvm/gems/ruby-2.2.6/gems/activerecord-4.2.4/lib/active_record/dynamic_matchers.rb:26:in method_missing' from /home/mnd/.rvm/gems/ruby-2.2.6/gems/elastic_ransack-0.0.1/lib/elastic_ransack/search.rb:100:inmethod_missing' from /home/mnd/.rvm/gems/ruby-2.2.6/gems/elastic_ransack-0.0.1/lib/elastic_ransack/search.rb:42:in search' from /home/mnd/.rvm/gems/ruby-2.2.6/gems/elastic_ransack-0.0.1/lib/elastic_ransack/model.rb:44:inelastic_ransack' from (irb):58 from /home/mnd/.rvm/gems/ruby-2.2.6/gems/railties-4.2.4/lib/rails/commands/console.rb:110:in start'

I have Complaint model as class Complaint < ActiveRecord::Base include ElasticRansack::Model end

Please help resolving the issue