Module: RearHelpers::ClassMixin
- Includes:
- RearConstants
- Defined in:
- lib/rear/helpers.rb,
lib/rear/helpers/class.rb
Constant Summary
RearConstants::ASSETS__PATH, RearConstants::ASSETS__SUFFIX, RearConstants::ASSETS__SUFFIX_REGEXP, RearConstants::ASSOCS__STRUCT, RearConstants::COLUMNS__BOOLEAN_MAP, RearConstants::COLUMNS__DEFAULT_TYPE, RearConstants::COLUMNS__HANDLED_TYPES, RearConstants::COLUMNS__PANE_MAX_LENGTH, RearConstants::FILTERS__DECORATIVE_CMP, RearConstants::FILTERS__DEFAULT_TYPE, RearConstants::FILTERS__HANDLED_TYPES, RearConstants::FILTERS__QUERY_MAP, RearConstants::FILTERS__STR_TO_BOOLEAN, RearConstants::PAGER__SIDE_PAGES, RearConstants::PATH__TEMPLATES
Instance Method Summary
collapse
Instance Method Details
#assocs ⇒ Object
15
16
17
18
19
|
# File 'lib/rear/helpers/class.rb', line 15
def assocs
@__rear__managed_assocs ||= (@__rear__assocs || {}).inject({}) do |map,(type,assocs)|
map.merge type => assocs.reject {|assoc,*| ignored_assocs.include? assoc}
end
end
|
#columns ⇒ Object
keeps the list of “real” columns as well as “virtual” ones. virtual refers to columns displayed on pane/editor pages but does exists in db
24
25
26
|
# File 'lib/rear/helpers/class.rb', line 24
def columns
@__rear__columns ||= []
end
|
#default_label ⇒ Object
4
5
6
|
# File 'lib/rear/helpers/class.rb', line 4
def default_label
@__rear__default_label ||= self.name.gsub(/\W/, '_').freeze
end
|
#filters ⇒ Object
33
34
35
|
# File 'lib/rear/helpers/class.rb', line 33
def filters
mounted? ? @__rear__filters || {} : @__rear__filters ||= {}
end
|
#internal_filters ⇒ Object
41
42
43
|
# File 'lib/rear/helpers/class.rb', line 41
def internal_filters
mounted? ? @__rear__internal_filters || [] : @__rear__internal_filters ||= []
end
|
8
|
# File 'lib/rear/helpers/class.rb', line 8
def ; @__rear__menu_group end
|
#orm ⇒ Object
11
12
13
|
# File 'lib/rear/helpers/class.rb', line 11
def orm
@__rear__orm
end
|
#quick_filters ⇒ Object
37
38
39
|
# File 'lib/rear/helpers/class.rb', line 37
def quick_filters
mounted? ? @__rear__quick_filters || {} : @__rear__quick_filters ||= {}
end
|
#readonly? ⇒ Boolean
9
|
# File 'lib/rear/helpers/class.rb', line 9
def readonly?; @__rear__readonly end
|
#real_columns ⇒ Object
keeps the list of columns that “physically” exists in db
29
30
31
|
# File 'lib/rear/helpers/class.rb', line 29
def real_columns
@__rear__real_columns || []
end
|