Skip to content

Instantly share code, notes, and snippets.

@mig
Created August 5, 2008 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mig/4090 to your computer and use it in GitHub Desktop.
Save mig/4090 to your computer and use it in GitHub Desktop.
methods from serialized attributes
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