Module: Model::MetaNamespace
- Extended by:
- ActiveSupport::Concern
- Included in:
- Com::MetaNamespace
- Defined in:
- app/models/com/model/meta_namespace.rb
Instance Method Summary collapse
- #name ⇒ Object
- #role_hash(business_identifier = '') ⇒ Object
- #role_path(business_identifier = '') ⇒ Object
- #tr_id(business_identifier) ⇒ Object
Instance Method Details
#name ⇒ Object
18 19 20 21 22 23 24 |
# File 'app/models/com/model/meta_namespace.rb', line 18 def name if super.present? super else identifier end end |
#role_hash(business_identifier = '') ⇒ Object
38 39 40 41 |
# File 'app/models/com/model/meta_namespace.rb', line 38 def role_hash(business_identifier = '') = MetaController.includes(:meta_actions).where(business_identifier: business_identifier.to_s, namespace_identifier: identifier) .each_with_object({}) { |i, h| h.merge! i.controller_path => i.role_hash } end |
#role_path(business_identifier = '') ⇒ Object
30 31 32 33 34 35 36 |
# File 'app/models/com/model/meta_namespace.rb', line 30 def role_path(business_identifier = '') { business_identifier.to_s => { identifier => role_hash(business_identifier) } } end |
#tr_id(business_identifier) ⇒ Object
26 27 28 |
# File 'app/models/com/model/meta_namespace.rb', line 26 def tr_id(business_identifier) "tr_#{business_identifier}_#{identifier.blank? ? '_' : identifier}" end |