heartcombo--simple_form/lib/simple_form/map_type.rb

14 lines
302 B
Ruby
Raw Normal View History

2009-12-09 17:48:40 +00:00
module SimpleForm
module MapType
def mappings
@mappings ||= {}
end
def map_type(*types)
map_to = types.extract_options![:to]
raise ArgumentError, "You need to give :to as option to map_type" unless map_to
types.each { |t| mappings[t] = map_to }
2009-12-09 17:48:40 +00:00
end
end
end