|
|
|
Some resources may have extra configurations that can be set in your ```application.rb``` as following:
|
|
|
|
```ruby
|
|
|
|
# application.rb
|
|
|
|
Torque::PostgreSQL.configure do |c|
|
|
|
|
c.enum.initializer = true
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
## <a name="enum"></a>Enum configurations
|
|
|
|
|
|
|
|
These are the keys available to configure Enum features:
|
|
|
|
|
|
|
|
<a name="enum.initializer"></a>`enum.initializer` Indicates if the enum features on ActiveRecord::Base should be initiated automatically or not. When is set to false, you have to manually call `enum :column` in each model that you want to use this resource.
|
|
|
|
Default value: `false`
|
|
|
|
|
|
|
|
<a name="enum.base_method"></a>`enum.base_method` The name of the method to be used on any ActiveRecord::Base to initialize model-based enum features.
|
|
|
|
Default value: `:enum`
|
|
|
|
|
|
|
|
<a name="enum.save_on_bang"></a>`enum.save_on_bang` Indicates if bang methods like 'disabled!' should update the record on database or not.
|
|
|
|
Default value: `true`
|
|
|
|
|
|
|
|
<a name="enum.namespace"></a>`enum.namespace` Specify the namespace of each enum type of value, such as `::Enum::Roles`.
|
|
|
|
Default value: `::Enum`
|
|
|
|
|
|
|
|
<a name="enum.i18n_scopes"></a>`enum.i18n_scopes` Specify the scopes for I18n translations.
|
|
|
|
Default value:
|
|
|
|
```ruby
|
|
|
|
[ 'activerecord.attributes.%{model}.%{attr}.%{value}',
|
|
|
|
'activerecord.attributes.%{attr}.%{value}',
|
|
|
|
'activerecord.enums.%{type}.%{value}',
|
|
|
|
'enum.%{type}.%{value}',
|
|
|
|
'enum.%{value}' ]
|
|
|
|
```
|
|
|
|
|
|
|
|
<a name="enum.i18n_type_scope"></a>`enum.i18n_type_scope` Specify the scopes for I18n translations, detached from model.
|
|
|
|
Default value: `# Same list as before but without items that have ${attr} or %{model}` |
|
|
|
\ No newline at end of file |