opened
mohameddiaa27
username_0
<!--- ⚠️ If you do not respect this template your issue will be closed. -->
<!-- ⚠️ Make sure to browse the opened and closed issues before submitting your issue. -->

#### Elevator pitch, describe and sell us your feature request

<!--- Tell us how this feature would better improve your user experience -->
<!--- Be concise try to sale it in one or two sentences -->
<!--- You can expand further on your idea in the Additional Comments -->

**As a** rails developer<!-- what role benefits from this request (i.e. user, developer, admin) -->,
**I want** to be able to define default value to a specific attribute<!-- what is the goal or desire of the request -->
**so that** I can have a dry code for default usage<!-- what benefit does your request provide? -->

#### Is your feature request related to a problem

<!--- A clear and concise description of what the problem is. -->
<!--- Ex. I'm always frustrated when [...] -->
I'm always frustrated when I pass variables every time to make the command dynamic, when most of the time these variables can fall back to defaults.  

```ruby
class MyInteractorContext < ActiveInteractor::Context::Base
  attribute :locale, default: -> { I18n.locale }
  attribute :year, default: -> { Date.today.year }
  attribute :format, default: :json
end
```

#### Have you considered any alternatives

<!--- Is there a compromise to the feature you're requesting? -->

#### Additional Comments

<!--- Is there any more details you'd like to provide about this feature? -->
<!--- Is there another feature in the tracker that are related to yours? -->

Following active model practices [active_model/attributes.rb#L25](https://github.com/rails/rails/blob/f33d52c95217212cbacc8d5e44b5a8e3cdc6f5b3/activemodel/lib/active_model/attributes.rb#L25)

Generally being able to define a specific `attribute` can enable more functionality like: **adding `type_cast`**. *Example: Typecasting a checkbox parameter to boolean*
Attribute Default Value
issue
created
aaronmallen
username_1
@username_0 thanks for your feature request.  I am working on implementing the `ActiveModel::Attributes` api in #137 now and hope to have it out in the next patch release.  In the mean time a good work around would be to specify defaults for an attribute in a `before_context_validation` or `before_perform` callback.
comment
closed
aaronmallen
username_1
issue
created
aaronmallen
username_1
@username_0 the feature has been released and is now available in v1.0.1
comment
created
mohameddiaa27
username_0
Perfect 👌
Thanks! That was quick 🚀
comment