title: Rails model "before_filter"?
body: <p>I know that before_filter is only for controllers in Rails, but I would like something like this for a model: any time a method in my model is called, I'd like to run a method that determines whether the called method should run. Conceptually, something like this:</p>
  
  <pre><code>class Website &lt; ActiveRecord::Base
    before_filter :confirm_company
  
    def confirm_company
      if self.parent.thing == false?
        return false
      end
    end
  
    def method1
      #do stuff
    end
  
  end
  </code></pre>
  
  <p>So when I call @website.method1, it will first call confirm_company, and if I return false, will not run method1. Does Rails have functionality like this? I hope i'm just missing out on something obvious here...</p>