Skip to content

Instantly share code, notes, and snippets.

@porras
Created November 1, 2009 21:38
Show Gist options
  • Select an option

  • Save porras/223738 to your computer and use it in GitHub Desktop.

Select an option

Save porras/223738 to your computer and use it in GitHub Desktop.
class Asset < ActiveRecord::Base
class << self
def method_missing(meth, *args, &blk)
if asset = first(:conditions => {:name => meth.to_s})
asset.value
else
super
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment