|
|
Some resources may have extra configurations that can be set in your ```application.rb``` as following:
|
|
|
Some resources may have extra configurations that can be set in your `application.rb` as following:
|
|
|
```ruby
|
|
|
# application.rb
|
|
|
Torque::PostgreSQL.configure do |c|
|
... | ... | @@ -10,12 +10,18 @@ end |
|
|
|
|
|
These are the keys available to configure general features:
|
|
|
|
|
|
<a name="eager_load"></a>`eager_load` Set if any information that requires querying and searching or collecting information shoul be eager loaded. This automatically changes when rails same configuration is set to true.
|
|
|
<a name="eager_load"></a>`eager_load` Set if any information that requires querying and searching or collecting information should be eager loaded. This automatically changes when rails same configuration is set to true.
|
|
|
Default value: `false`
|
|
|
|
|
|
<a name="irregular_models"></a>`irregular_models` Set a list of irregular model names when associated with table names. It uses the `'table_name' => 'model_name'` format. This is widely used for inheritance, because record types need to be associated with a model class.
|
|
|
<a name="irregular_models"></a>`irregular_models` Set a list of irregular model names when associated with table names. It uses the `'table_name' => 'model_name'` format. This is widely used for inheritance because record types need to be associated with a model class.
|
|
|
Default value: `{}`
|
|
|
|
|
|
## <a name="associations"></a>Associations configurations
|
|
|
|
|
|
These are the keys available to configure associations features:
|
|
|
<a name="associations.belongs_to_many_required_by_default"></a>`associations.belongs_to_many_required_by_default` Define if `belongs_to_many` associations are marked as required by default. `false` means that no validation will be performed.
|
|
|
Default value: `false`
|
|
|
|
|
|
## <a name="auxiliary_statement"></a>Auxiliary statements configurations
|
|
|
|
|
|
These are the keys available to configure Auxiliary statements features:
|
... | ... | @@ -23,16 +29,19 @@ These are the keys available to configure Auxiliary statements features: |
|
|
<a name="auxiliary_statement.send_arguments_key"></a>`auxiliary_statement.send_arguments_key` Define the key that is used on auxiliary statements to send extra arguments to format string or send on a proc.
|
|
|
Default value: `:args`
|
|
|
|
|
|
<a name="auxiliary_statement.exposed_class"></a>`auxiliary_statement.exposed_class` Estipulate a class name (which may contain namespace) that expose the auxiliary statement in order to perform detached CTEs.
|
|
|
Default value: `'TorqueCTE'`
|
|
|
|
|
|
## <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 it 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.set_method"></a>`enum.set_method` The name of the method to be used on any ActiveRecord::Base to initialize model-based enum set features.
|
|
|
Default value: `:enum_set`
|
|
|
|
|
|
<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`
|
|
|
|
... | ... | @@ -41,7 +50,7 @@ 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}',
|
... | ... | @@ -52,6 +61,25 @@ Default 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}`
|
|
|
|
|
|
## <a name="geometry"></a>Geometry configurations
|
|
|
|
|
|
These are the keys available to configure geometries features:
|
|
|
|
|
|
<a name="geometry.point_class"></a>`geometry.point_class` Define the class that will be handling Point data types after decoding it. Any class provided here must respond to 'x', and 'y'.
|
|
|
Default value: `ActiveRecord::Point`
|
|
|
|
|
|
<a name="geometry.point_class"></a>`geometry.point_class` Define the class that will be handling Circle data types after decoding it. Any class provided here must respond to 'x', 'y', and 'r'.
|
|
|
Default value: `nil # Which will define an internal Circle class`
|
|
|
|
|
|
<a name="geometry.point_class"></a>`geometry.point_class` Define the class that will be handling Box data types after decoding it. Any class provided here must respond to 'x1', 'y1', 'x2', and 'y2'.
|
|
|
Default value: `nil # Which will define an internal Box class`
|
|
|
|
|
|
<a name="geometry.point_class"></a>`geometry.point_class` Define the class that will be handling Line data types after decoding it. Any class provided here must respond to 'a', 'b', and 'c'.
|
|
|
Default value: `nil # Which will define an internal Line class`
|
|
|
|
|
|
<a name="geometry.point_class"></a>`geometry.point_class` Define the class that will be handling Segment data types after decoding it. Any class provided here must respond to 'x1', 'y1', 'x2', and 'y2'.
|
|
|
Default value: `nil # Which will define an internal Segment class`
|
|
|
|
|
|
## <a name="inheritance"></a>Inheritance configurations
|
|
|
|
|
|
These are the keys available to configure Inheritance features:
|
... | ... | @@ -64,3 +92,46 @@ Default value: `:_record_class` |
|
|
|
|
|
<a name="inheritance.auto_cast_column_name"></a>`inheritance.auto_cast_column_name` Determines the name of the column used when identifying that the loaded records should be casted to its correctly model. This will be TRUE for the records mentioned on `cast_records`.
|
|
|
Default value: `:_auto_cast`
|
|
|
|
|
|
## <a name="period"></a>Period configurations
|
|
|
|
|
|
These are the keys available to configure Period features:
|
|
|
|
|
|
<a name="period.base_method"></a>`period.base_method` The name of the method to be used on any ActiveRecord::Base to initialize model-based period features.
|
|
|
Default value: `:period_for`
|
|
|
|
|
|
<a name="period.method_names"></a>`period.method_names` Define the list of methods that will be created by default while setting up a new period field. Note that `%s` will be replaced by the name of the filter.
|
|
|
Default value:
|
|
|
```
|
|
|
{ current_on: '%s_on',
|
|
|
current: 'current_%s',
|
|
|
not_current: 'not_current_%s',
|
|
|
containing: '%s_containing',
|
|
|
not_containing: '%s_not_containing',
|
|
|
overlapping: '%s_overlapping',
|
|
|
not_overlapping: '%s_not_overlapping',
|
|
|
starting_after: '%s_starting_after',
|
|
|
starting_before: '%s_starting_before',
|
|
|
finishing_after: '%s_finishing_after',
|
|
|
finishing_before: '%s_finishing_before',
|
|
|
|
|
|
real_containing: '%s_real_containing',
|
|
|
real_overlapping: '%s_real_overlapping',
|
|
|
real_starting_after: '%s_real_starting_after',
|
|
|
real_starting_before: '%s_real_starting_before',
|
|
|
real_finishing_after: '%s_real_finishing_after',
|
|
|
real_finishing_before: '%s_real_finishing_before',
|
|
|
|
|
|
containing_date: '%s_containing_date',
|
|
|
not_containing_date: '%s_not_containing_date',
|
|
|
overlapping_date: '%s_overlapping_date',
|
|
|
not_overlapping_date: '%s_not_overlapping_date',
|
|
|
|
|
|
current?: 'current_%s?'
|
|
|
current_on?: 'current_%s_on?'
|
|
|
start: '%s_start',
|
|
|
finish: '%s_finish',
|
|
|
real: 'real_%s',
|
|
|
real_start: '%s_real_start',
|
|
|
real_finish: '%s_real_finish' }
|
|
|
``` |
|
|
\ No newline at end of file |