Skip to content
  • Yasuo Honda's avatar
    676fe1b8
    Address `Defining enums with keyword arguments` warning in Action Mailbox · 676fe1b8
    Yasuo Honda authored
    This commit addresses `DEPRECATION WARNING: Defining enums with keyword arguments is deprecated and will be removed`
    warning in Action Mailbox.
    
    * Steps to reproduce
    ```ruby
    git clone https://github.com/rails/rails
    cd rails/actionmailbox
    bundle install
    bin/test test/unit/router_test.rb
    ```
    
    * Without this commit
    ```
    $ bin/test test/unit/router_test.rb
    ... snip ..
    DEPRECATION WARNING: Defining enums with keyword arguments is deprecated and will be removed
    in Rails 7.3. Positional arguments should be used instead:
    
    enum :status, [:pending, :processing, :delivered, :failed, :bounced]
     (called from <class:InboundEmail> at /home/yahonda/src/github.com/rails/rails/actionmailbox/app/models/action_mailbox/inbound_email.rb:31)
    Run options: --seed 65254
    
    ...............
    
    Finished in 0.230357s, 65.1163 runs/s, 108.5271 assertions/s.
    15 runs, 25 assertions, 0 failures, 0 errors, 0 skips
    $
    ```
    
    Follow up https://github.com/rails/rails/pull/50987
    Refer to https://github.com/rails/rails/pull/51037
    676fe1b8
    Address `Defining enums with keyword arguments` warning in Action Mailbox
    Yasuo Honda authored
    This commit addresses `DEPRECATION WARNING: Defining enums with keyword arguments is deprecated and will be removed`
    warning in Action Mailbox.
    
    * Steps to reproduce
    ```ruby
    git clone https://github.com/rails/rails
    cd rails/actionmailbox
    bundle install
    bin/test test/unit/router_test.rb
    ```
    
    * Without this commit
    ```
    $ bin/test test/unit/router_test.rb
    ... snip ..
    DEPRECATION WARNING: Defining enums with keyword arguments is deprecated and will be removed
    in Rails 7.3. Positional arguments should be used instead:
    
    enum :status, [:pending, :processing, :delivered, :failed, :bounced]
     (called from <class:InboundEmail> at /home/yahonda/src/github.com/rails/rails/actionmailbox/app/models/action_mailbox/inbound_email.rb:31)
    Run options: --seed 65254
    
    ...............
    
    Finished in 0.230357s, 65.1163 runs/s, 108.5271 assertions/s.
    15 runs, 25 assertions, 0 failures, 0 errors, 0 skips
    $
    ```
    
    Follow up https://github.com/rails/rails/pull/50987
    Refer to https://github.com/rails/rails/pull/51037
Loading