Module: Model::MetaAction
- Extended by:
- ActiveSupport::Concern
- Included in:
- Com::MetaAction
- Defined in:
- app/models/com/model/meta_action.rb
Instance Method Summary collapse
- #identifier ⇒ Object
- #name ⇒ Object
- #role_hash ⇒ Object
- #role_path ⇒ Object
- #sync_from_controller ⇒ Object
Instance Method Details
#identifier ⇒ Object
50 51 52 |
# File 'app/models/com/model/meta_action.rb', line 50 def identifier [business_identifier, namespace_identifier, controller_path, (action_name.blank? ? '_' : action_name)].join('_') end |
#name ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'app/models/com/model/meta_action.rb', line 54 def name t1 = I18n.t "#{[business_identifier, namespace_identifier, controller_name, action_name].join('.')}.title", default: nil return t1 if t1 t2 = self.class.enum_i18n :action_name, self.action_name return t2 if t2 identifier end |
#role_hash ⇒ Object
46 47 48 |
# File 'app/models/com/model/meta_action.rb', line 46 def role_hash id end |
#role_path ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'app/models/com/model/meta_action.rb', line 36 def role_path { business_identifier.to_s => { namespace_identifier.to_s => { controller_path => { action_name => role_hash } } } } end |
#sync_from_controller ⇒ Object
64 65 66 67 |
# File 'app/models/com/model/meta_action.rb', line 64 def sync_from_controller self.business_identifier = .business_identifier self.namespace_identifier = .namespace_identifier end |