Module: Aikotoba::Scopable
- Extended by:
- ActiveSupport::Concern
- Included in:
- ApplicationController, Authenticatable
- Defined in:
- app/controllers/concerns/aikotoba/scopable.rb
Instance Method Summary collapse
- #aikotoba_scope ⇒ Object
- #aikotoba_scope_config ⇒ Object
- #aikotoba_scoped_path(path, *params) ⇒ Object
Instance Method Details
#aikotoba_scope ⇒ Object
15 16 17 |
# File 'app/controllers/concerns/aikotoba/scopable.rb', line 15 def aikotoba_scope @aikotoba_scope ||= aikotoba_calc_scope_from(request.path).to_s.inquiry end |
#aikotoba_scope_config ⇒ Object
5 6 7 |
# File 'app/controllers/concerns/aikotoba/scopable.rb', line 5 def aikotoba_scope_config Aikotoba.scopes[aikotoba_scope] end |
#aikotoba_scoped_path(path, *params) ⇒ Object
9 10 11 12 13 |
# File 'app/controllers/concerns/aikotoba/scopable.rb', line 9 def aikotoba_scoped_path(path, *params) return aikotoba.public_send(path, *params) if aikotoba_scope.default? aikotoba.public_send("#{aikotoba_scope}_#{path}", *params) end |