Created
January 7, 2011 09:57
-
-
Save bernerdschaefer/769304 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
module DataMapper | |
class Property | |
class Integer | |
# HACK: Unfortunately, datamapper doesn't seem to like setting | |
# association keys to blank strings, instead requiring something numeric | |
# or nil, so we must typecast blank values to nil. | |
def typecast(value) | |
value.blank? ? nil : super | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment