title: How to prevent duplicate records being created, but all other before_create methods to run?
body: <p>A Rails app has an Event and Vote model. Events should be unique. </p>
  
  <p>If a User attempts to create an Event that already exists, save should be prevented, and instead a Vote should be created for the existing Event.</p>
  
  <p>I can prevent the Event from being saved using a custom validation or a <code>before_create</code> action. However, this also prevents the <code>create_vote_on_existing_event</code> method from being run. </p>
  
  <p>Is there a way to selectively run methods when <code>before_create</code> returns false?</p>
  
  <p>My models look something like this</p>
  
  <pre><code>class Event
    has_many :votes
    before_create :check_event_is_unique
  private
    def check_event_is_unique
      if Event.where( attributes_to_match).any?
        errors.add(:base, :duplicate)
        create_vote_on_existing_event
        return false
      end
    end
  
    def create_vote_on_existing_event
      event = Event.where( attributes_to_match).last
      self.user.vote_on event 
    end
  end
  class Vote
    belongs_to :event
  end
  </code></pre>