Module: Model::MetaBusiness
- Extended by:
- ActiveSupport::Concern
- Included in:
- Com::MetaBusiness
- Defined in:
- app/models/com/model/meta_business.rb
Instance Method Summary collapse
Instance Method Details
#meta_namespaces ⇒ Object
33 34 35 |
# File 'app/models/com/model/meta_business.rb', line 33 def MetaNamespace.where(identifier: MetaController.unscope(:order).select(:namespace_identifier).where(business_identifier: identifier).distinct.pluck(:namespace_identifier)).order(id: :asc) end |
#name ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'app/models/com/model/meta_business.rb', line 20 def name return super if super.present? t = I18n.t "#{identifier}.title", default: nil return t if t identifier end |
#role_hash ⇒ Object
43 44 45 |
# File 'app/models/com/model/meta_business.rb', line 43 def role_hash .each_with_object({}) { |i, h| h.merge! i.identifier => i.role_hash(identifier) } end |
#role_path ⇒ Object
37 38 39 40 41 |
# File 'app/models/com/model/meta_business.rb', line 37 def role_path { identifier => role_hash } end |
#tr_id ⇒ Object
29 30 31 |
# File 'app/models/com/model/meta_business.rb', line 29 def tr_id "tr_#{identifier.blank? ? '_' : identifier}" end |