Merge pull request #167 from GateGuru/feature/specify-association-serializers-as-strings

Add support for specifying the serializer for an association as a String...
This commit is contained in:
Steve Klabnik
2013-03-05 15:04:29 -08:00
2 changed files with 24 additions and 1 deletions

View File

@@ -39,7 +39,8 @@ module ActiveModel
end
def target_serializer
option(:serializer)
serializer = option(:serializer)
serializer.is_a?(String) ? serializer.constantize : serializer
end
def source_serializer