Created
August 5, 2008 16:00
-
-
Save mig/4090 to your computer and use it in GitHub Desktop.
methods from serialized attributes
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
def attr_serialized_on(column, *attributes) | |
attributes.each do |a| | |
class_eval do | |
define_method(a) { meta(a) } | |
define_method(a.to_s + "=(value)") { metadata[a] = value } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment