module Form::ActiveModel::ModelReflections

Public Class Methods

included(base) click to toggle source
# File lib/reform/form/active_model/model_reflections.rb, line 8
def self.included(base)
  base.extend ClassMethods
  base.send :register_feature, self # makes it work in nested forms.
end

Public Instance Methods

column_for_attribute(name) click to toggle source

Delegate column for attribute to the model to support simple_form's attribute type interrogation.

# File lib/reform/form/active_model/model_reflections.rb, line 28
def column_for_attribute(name)
  model_for_property(name).column_for_attribute(name)
end
defined_enums() click to toggle source
# File lib/reform/form/active_model/model_reflections.rb, line 36
def defined_enums
  return model.defined_enums unless is_a?(Reform::Form::Composition)

  mapper.each.with_object({}) { |m,h| h.merge! m.defined_enums }
end
has_attribute?(name) click to toggle source
# File lib/reform/form/active_model/model_reflections.rb, line 32
def has_attribute?(name)
  model_for_property(name).has_attribute?(name)
end