Skip to content

Instantly share code, notes, and snippets.

@josefrichter
Created March 20, 2013 13:18
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 josefrichter/5204573 to your computer and use it in GitHub Desktop.
Save josefrichter/5204573 to your computer and use it in GitHub Desktop.
class Myrecord < ActiveRecord::Base
# property :id, Serial
# property :name, String, length: 4..35
# property :desc, Text
#
# timestamps :at
#
attr_accessor :foo # this one is NOT persisted in database
end
m = Myrecord.create({name: "new name", desc: "new desc"})
m.foo # => nil
m.foo = "bar" # => "bar"
m # => {name: "new name", desc: "new desc"} # foo is not there
m.foo # => nil
# why is it still nil ?
@Favorwilliams
Copy link

My Pleasure to write you,
My name is Favor Williams,
My email address is
( Favor24@live.com)
Am interested to know
more about you,
Contact me for my
photo and other
important issue via,

Favor24@live.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment