title: Rails before_save not working
body: <p>I have a before-save action that is supposed to assign a user to a default role, but on creation a user is not assigned a role.</p>
  
  <p>My code:</p>
  
  <pre><code> before_save :assign_default_role, if: Proc.new { |user| user.role == nil }
  
    def assign_default_role
      self.role = Role.where(code: 'user').first
    end
  </code></pre>