title: undefined method `before_action' for ActionMailer
body: <p>Trying to attach file to mail via before_action filter:</p>
  
  <pre><code>class UserMailer &lt; ActionMailer::Base
    before_action :add_logo_attachment
  
    layout 'mail'
    default from: "\"Admin\" &lt;admin@site.com&gt;",
        to: Proc.new {Admin.pluck(:email)}
  
    def send_mail
      mail(subject: 'Hello, admin!')
    end
    .
    .
    private
  
    def add_logo_attachment
      attachments.inline['logo.png'] = File.read(Rails.root.join('app/assets/images/logo.png'))
    end
  
  end
  </code></pre>
  
  <p>And I get this error: undefined method `before_action' for UserMailer:Class
  There is the same example in Rails guides and I can't understand what's the difference between my code and the code in guides. </p>