Module: CompanyScope::Filter::FilterMethods
- Defined in:
- lib/company_scope/filter.rb
Instance Method Summary collapse
- #company_scope_company_not_set ⇒ Object
- #current_company_id ⇒ Object
- #filter_by_current_company_scope ⇒ Object
Instance Method Details
#company_scope_company_not_set ⇒ Object
27 28 29 |
# File 'lib/company_scope/filter.rb', line 27 def company_scope_company_not_set redirect_to(wrong_company_path) and return end |
#current_company_id ⇒ Object
14 15 16 17 18 |
# File 'lib/company_scope/filter.rb', line 14 def current_company_id @company_id = request.env["COMPANY_ID"] raise CompanyScope::Control::CompanyAccessViolationError if @company_id.nil? @company_id end |
#filter_by_current_company_scope ⇒ Object
20 21 22 23 24 25 |
# File 'lib/company_scope/filter.rb', line 20 def filter_by_current_company_scope scope_class.current_id = current_company_id yield ensure scope_class.current_id = nil end |