Skip to content
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

undefined method `conditions' (Rails 3.2.12, Tanker 1.1.6) #68

Open
stevegrossi opened this issue May 4, 2013 · 3 comments
Open

undefined method `conditions' (Rails 3.2.12, Tanker 1.1.6) #68

stevegrossi opened this issue May 4, 2013 · 3 comments

Comments

@stevegrossi
Copy link

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
Copy link

ntlk commented Jul 19, 2013

Did you get this resolved? I've also come across this

@stevegrossi
Copy link
Author

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
Copy link

ntlk commented Jul 24, 2013

@stevegrossi Oh, very good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants