Skip to content

Instantly share code, notes, and snippets.

@alvinsj
Created May 11, 2011 09:16
Show Gist options
  • Save alvinsj/966159 to your computer and use it in GitHub Desktop.
Save alvinsj/966159 to your computer and use it in GitHub Desktop.
Get ActiveRecord::Base attribute/property with String
module ActiveRecord
class Base
def set_attr(key,value)
write_attribute(key, value)
end
def get_attr(key)
read_attribute(key)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment