Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default: support for ActiveSupport::CurrentAttributes.attribute #50677

Merged
merged 1 commit into from
Jan 10, 2024

Commits on Jan 10, 2024

  1. Add default: support for ActiveSupport::CurrentAttributes.attribute

    Extend the `.attribute` class method to accept a `:default` option for
    its list of attributes:
    
    ```ruby
    class Current < ActiveSupport::CurrentAttributes
      attribute :counter, default: 0
    end
    ```
    
    Internally, `ActiveSupport::CurrentAttributes` will maintain a
    `.defaults` class attribute to determine default values during instance
    initialization.
    seanpdoyle committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    d1d6b6b View commit details
    Browse the repository at this point in the history