Class: JSAdmin::Configuration
- Inherits:
-
Object
- Object
- JSAdmin::Configuration
- Defined in:
- lib/js_admin/configuration.rb
Instance Attribute Summary collapse
-
#association_limit ⇒ Object
Returns the value of attribute association_limit.
-
#display_name_methods ⇒ Object
Returns the value of attribute display_name_methods.
-
#excluded_models ⇒ Object
Returns the value of attribute excluded_models.
-
#included_models ⇒ Object
Returns the value of attribute included_models.
-
#records_per_page ⇒ Object
Returns the value of attribute records_per_page.
Instance Method Summary collapse
- #exclude_models(*models) ⇒ Object
- #include_models(*models) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 11 12 |
# File 'lib/js_admin/configuration.rb', line 6 def initialize @included_models = [] @excluded_models = [] @records_per_page = 25 @association_limit = 100 @display_name_methods = %i[name title email username id] end |
Instance Attribute Details
#association_limit ⇒ Object
Returns the value of attribute association_limit.
3 4 5 |
# File 'lib/js_admin/configuration.rb', line 3 def association_limit @association_limit end |
#display_name_methods ⇒ Object
Returns the value of attribute display_name_methods.
3 4 5 |
# File 'lib/js_admin/configuration.rb', line 3 def display_name_methods @display_name_methods end |
#excluded_models ⇒ Object
Returns the value of attribute excluded_models.
3 4 5 |
# File 'lib/js_admin/configuration.rb', line 3 def excluded_models @excluded_models end |
#included_models ⇒ Object
Returns the value of attribute included_models.
3 4 5 |
# File 'lib/js_admin/configuration.rb', line 3 def included_models @included_models end |
#records_per_page ⇒ Object
Returns the value of attribute records_per_page.
3 4 5 |
# File 'lib/js_admin/configuration.rb', line 3 def records_per_page @records_per_page end |
Instance Method Details
#exclude_models(*models) ⇒ Object
18 19 20 |
# File 'lib/js_admin/configuration.rb', line 18 def exclude_models(*models) excluded_models.concat(normalize_model_names(models)) end |
#include_models(*models) ⇒ Object
14 15 16 |
# File 'lib/js_admin/configuration.rb', line 14 def include_models(*models) included_models.concat(normalize_model_names(models)) end |