title: Rails - really_create_a_version in the model
body: <p>I'm using the Rails 3 Vestal Versions gem: <a href="https://github.com/lailsonbm/vestal_versions" rel="nofollow">https://github.com/lailsonbm/vestal_versions</a></p>
  
  <p>I'd like to create some logic to determine if/when to create a new version on a model update. Per the specs, I did:</p>
  
  <pre><code>class Note &lt; ActiveRecord::Base
      versioned :if =&gt; :really_create_a_version?
  
    def really_create_a_version
      Rails.logger.debug 'really_create_a_version really_create_a_version really_create_a_version really_create_a_version - START'
      record.inspect
      @note = Note.find(32)
      Rails.logger.debug 'really_create_a_version really_create_a_version really_create_a_version really_create_a_version - END'
    end
  
  end
  </code></pre>
  
  <p>But that doesn't work, I get the following error:</p>
  
  <pre><code>NoMethodError (undefined method `really_create_a_version?' for #&lt;Note:0x155c39a28&gt;):
    app/controllers/notes_controller.rb:124:in `update'
  </code></pre>
  
  <p>Any suggestions or ideas? thxs</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Conditional version creation. The versioned method now accepts :if and :unless options. Each expects a symbol representing an instance method or a proc that will be evaluated to determine whether or not to create a new version after an update. An array containing any combination of symbols and procs can also be given.
    class User &lt; ActiveRecord::Base
      versioned :if => :really_create_a_version?
    end</p>