lib/transcriber/resource/key/association.rb in transcriber-0.0.15 vs lib/transcriber/resource/key/association.rb in transcriber-0.0.16
- old
+ new
@@ -20,21 +20,16 @@
def default_class_name
one? ? name : name.to_s.singularize
end
def resource_class
- @class_name.constantize
+ @class_name.to_s.camelize.constantize
end
def from_hash(attrs)
return nil if attrs.nil? or attrs.empty?
one? ? resource_class.new(attrs)
: Array(attrs).map {|item| resource_class.new(item)}
- end
-
- def to_input(value, options = {})
- return nil if value.nil?
- one? ? value.to_input(options) : value.map {|item| item.to_input(options)}
end
end
end
end