module MarkMapper::Plugins::Rails::ClassMethods
Public Instance Methods
column_names()
click to toggle source
# File lib/mark_mapper/plugins/rails.rb, line 58 def column_names unaliased_keys.keys end
create_accessors_for(key)
click to toggle source
Calls superclass method
# File lib/mark_mapper/plugins/rails.rb, line 69 def create_accessors_for(key) super do define_method "#{key.name}_before_type_cast" do read_attribute_before_type_cast key.name end end end
has_many(*args, &extension)
click to toggle source
# File lib/mark_mapper/plugins/rails.rb, line 54 def has_many(*args, &extension) many(*args, &extension) end
has_one(*args)
click to toggle source
# File lib/mark_mapper/plugins/rails.rb, line 50 def has_one(*args) one(*args) end
reflect_on_association(name)
click to toggle source
Returns returns an ActiveRecordAssociationAdapter
for an association. This adapter has an API that is a subset of ActiveRecord::Reflection::AssociationReflection. This allows MarkMapper
to be used with the association helpers in gems like simple_form and formtastic.
# File lib/mark_mapper/plugins/rails.rb, line 65 def reflect_on_association(name) ActiveRecordAssociationAdapter.for_association(associations[name]) if associations[name] end