Created
October 6, 2008 21:09
-
-
Save paul/15144 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostgresAdapter | |
def translate_attribute(attribute) | |
case attribute | |
when Numeric | |
attribute.value | |
when String | |
quote_string(attribute.value) | |
when Array | |
attribute.value.map { |v| translate_attribute(v) }.join(',') | |
when attribute.value.respond_to?(dm_serialize) | |
attribute.value.respond_to?(dm_serialize(adapter)) | |
else | |
quote_string(attribute.to_s) | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment