Module: ClosureTree::SupportFlags
- Included in:
- Support
- Defined in:
- lib/closure_tree/support_flags.rb
Instance Method Summary collapse
- #has_inheritance_column?(hash = columns_hash) ⇒ Boolean
- #has_name? ⇒ Boolean
- #order_is_numeric? ⇒ Boolean
- #order_option? ⇒ Boolean
- #subclass? ⇒ Boolean
Instance Method Details
#has_inheritance_column?(hash = columns_hash) ⇒ Boolean
17 18 19 |
# File 'lib/closure_tree/support_flags.rb', line 17 def has_inheritance_column?(hash = columns_hash) hash.with_indifferent_access.include?(model_class.inheritance_column) end |
#has_name? ⇒ Boolean
21 22 23 |
# File 'lib/closure_tree/support_flags.rb', line 21 def has_name? model_class.new.attributes.include? [:name_column] end |
#order_is_numeric? ⇒ Boolean
9 10 11 |
# File 'lib/closure_tree/support_flags.rb', line 9 def order_is_numeric? [:numeric_order] end |
#order_option? ⇒ Boolean
5 6 7 |
# File 'lib/closure_tree/support_flags.rb', line 5 def order_option? order_by.present? end |
#subclass? ⇒ Boolean
13 14 15 |
# File 'lib/closure_tree/support_flags.rb', line 13 def subclass? model_class != model_class.base_class end |