Module: CompanyScope::Filter::FilterClassMethods
- Defined in:
- lib/company_scope/filter.rb
Instance Method Summary collapse
- #acts_as_company_filter ⇒ Object
- #company_setup ⇒ Object
-
#set_scoping_class(scope_model = :company) ⇒ Object
-
the default is set by the Rails application configuration!.
-
Instance Method Details
#acts_as_company_filter ⇒ Object
47 48 49 |
# File 'lib/company_scope/filter.rb', line 47 def acts_as_company_filter around_filter :filter_by_current_company_scope end |
#company_setup ⇒ Object
41 42 43 44 45 |
# File 'lib/company_scope/filter.rb', line 41 def company_setup helper_method :current_company #set_scoping_class Rails.application.config.company_scope[:company_model] set_scoping_class CompanyScope.config.company_model end |
#set_scoping_class(scope_model = :company) ⇒ Object
-
the default is set by the Rails application configuration!
34 35 36 37 38 39 |
# File 'lib/company_scope/filter.rb', line 34 def set_scoping_class(scope_model = :company) self.class_eval do cattr_accessor :scope_class end self.scope_class = scope_model.to_s.camelcase.constantize end |