Skip to content

Instantly share code, notes, and snippets.

@wesrog
Created December 16, 2009 15:37
Show Gist options
  • Save wesrog/257925 to your computer and use it in GitHub Desktop.
Save wesrog/257925 to your computer and use it in GitHub Desktop.
class ListItem < ActiveRecord::Base
belongs_to :list
serialize :data
def method_missing(meth)
if list.fields.map { |f| f.name.parameterize.underscore }.include?(meth)
data[meth.to_sym] if data
else
super
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment