undefined method `conditions' (Rails 3.2.12, Tanker 1.1.6)
stevegrossi opened this issue · comments
Steve Grossi commented
I just installed the latest tanker gem and began following the instructions in the readme, but the conditions block doesn't seem to be recognized:
undefined method `conditions' for #<Tanker::ModelConfig:0x007fdd84551270>
My model looks like this:
class Region < ActiveRecord::Base
include Tanker
....
tankit 'my_index' do
conditions do
indexable?
end
indexes :name
end
def indexable?
self.name?
end
end
ntlk commented
Did you get this resolved? I've also come across this
Steve Grossi commented
Unfortunately not. Including a conditions
block within the tankit
block as in the README still throws the error above when trying to boot Rails. My workaround has been to just add the condition to the callback:
after_save :update_tank_indexes, if: :indexable?
ntlk commented
@stevegrossi Oh, very good!