Class: Viewable::Form

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Admin::Viewable::Form, Viewable, Viewable::Field::UUID, Viewable::Field::Url, Splitter
Defined in:
app/models/viewable/form.rb

Defined Under Namespace

Modules: Splitter

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Viewable::Field::UUID

#other_uuid, #uuid, #uuid_with

Methods included from Viewable

#list, models, #other_locales, #short_type, #unique_key_hash

Class Method Details

.namesObject



16
17
18
# File 'app/models/viewable/form.rb', line 16

def names
  @_names ||= CMS.dir_names 'app/views/cms/forms'
end

.not_static?(name) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
# File 'app/models/viewable/form.rb', line 28

def not_static?(name)
  !static?(name)
end

.static?(name) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'app/models/viewable/form.rb', line 24

def static?(name)
  name.in? static_names
end

.static_namesObject



20
21
22
# File 'app/models/viewable/form.rb', line 20

def static_names
  @_static_names ||= CMS.rb_names 'app/models/form'
end

Instance Method Details

#form_nameObject



33
34
35
# File 'app/models/viewable/form.rb', line 33

def form_name
  @_form_name ||= view_path.split('/')[-2]
end

#not_static?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'app/models/viewable/form.rb', line 41

def not_static?
  !static?
end

#static?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'app/models/viewable/form.rb', line 37

def static?
  form_name.in? self.class.static_names
end