Skip to content
  • Vasiliy Ermolovich's avatar
    af112a2f
    Fix Zeitwerk autoloading when ActionMailer is not present. · af112a2f
    Vasiliy Ermolovich authored
    When ActionMailer is not defined we have empty app/mailers/devise/mailer.rb file and Zeitwerk doesn't
    like that and errors with
    
    ```
    expected file app/mailers/devise/mailer.rb to define constant Devise::Mailer
    ```
    
    The fix is to tell Zeitwerk to ignore that file if ActionMailer constant if not defined.
    
    I tried to write a spec for it but since specs are run in the same process it's hard to have two
    Rails applications where one of them has ActionMailer define and the seconds one doesn't.
    af112a2f
    Fix Zeitwerk autoloading when ActionMailer is not present.
    Vasiliy Ermolovich authored
    When ActionMailer is not defined we have empty app/mailers/devise/mailer.rb file and Zeitwerk doesn't
    like that and errors with
    
    ```
    expected file app/mailers/devise/mailer.rb to define constant Devise::Mailer
    ```
    
    The fix is to tell Zeitwerk to ignore that file if ActionMailer constant if not defined.
    
    I tried to write a spec for it but since specs are run in the same process it's hard to have two
    Rails applications where one of them has ActionMailer define and the seconds one doesn't.
Loading