Module: Lockdown::Helper

Included in:
Lockdown
Defined in:
lib/lockdown/helper.rb

Instance Method Summary collapse

Instance Method Details

#administrator_group_nameObject



12
13
14
# File 'lib/lockdown/helper.rb', line 12

def administrator_group_name
  'Administrators'
end

#regex(string) ⇒ Regexp

Returns with A z boundaries.

Returns:

  • (Regexp)

    with A z boundaries



8
9
10
# File 'lib/lockdown/helper.rb', line 8

def regex(string)
  Regexp.new(/\A#{string}\z/)
end

#user_classObject



28
29
30
# File 'lib/lockdown/helper.rb', line 28

def user_class
  eval("::#{Lockdown::Configuration.user_model}")
end

#user_group_classObject



16
17
18
# File 'lib/lockdown/helper.rb', line 16

def user_group_class
  eval("::#{Lockdown::Configuration.user_group_model}")
end

#user_group_id_referenceObject



24
25
26
# File 'lib/lockdown/helper.rb', line 24

def user_group_id_reference
  Lockdown::Configuration.user_group_model.underscore + "_id"
end

#user_groups_hbtm_referenceObject



20
21
22
# File 'lib/lockdown/helper.rb', line 20

def user_groups_hbtm_reference
  Lockdown::Configuration.user_group_model.underscore.pluralize.to_sym
end

#user_id_referenceObject



36
37
38
# File 'lib/lockdown/helper.rb', line 36

def user_id_reference
  Lockdown::Configuration.user_model.underscore + "_id"
end

#users_hbtm_referenceObject



32
33
34
# File 'lib/lockdown/helper.rb', line 32

def users_hbtm_reference
  Lockdown::Configuration.user_model.underscore.pluralize.to_sym
end