Module: Model::MetaController

Extended by:
ActiveSupport::Concern
Included in:
Com::MetaController
Defined in:
app/models/com/model/meta_controller.rb

Instance Method Summary collapse

Instance Method Details

#business_nameObject



36
37
38
39
40
41
# File 'app/models/com/model/meta_controller.rb', line 36

def business_name
  t = I18n.t "#{business_identifier}.title", default: nil
  return t if t

  business_identifier
end

#identifierObject



32
33
34
# File 'app/models/com/model/meta_controller.rb', line 32

def identifier
  [business_identifier, namespace_identifier, (controller_path.blank? ? '_' : controller_path)].join('_')
end

#nameObject



50
51
52
53
54
55
# File 'app/models/com/model/meta_controller.rb', line 50

def name
  t = I18n.t "#{controller_path.to_s.split('/').join('.')}.index.title", default: nil
  return t if t

  controller_path
end

#namespace_nameObject



43
44
45
46
47
48
# File 'app/models/com/model/meta_controller.rb', line 43

def namespace_name
  t = I18n.t "#{business_identifier}.#{namespace_identifier}.title", default: nil
  return t if t

  namespace_identifier
end

#role_hashObject



65
66
67
# File 'app/models/com/model/meta_controller.rb', line 65

def role_hash
  meta_actions.each_with_object({}) { |i, h| h.merge! i.action_name => i.role_hash }
end

#role_pathObject



57
58
59
60
61
62
63
# File 'app/models/com/model/meta_controller.rb', line 57

def role_path
  {
    business_identifier => {
      namespace_identifier => { controller_path => role_hash }
    }
  }
end