method
from_json
Register or
log in
to add new notes.
szeryf -
July 24, 2009
0 thanks
Instance method
Please note that this is an instance method, not a class method (which seemed more logical for me and took me a while to see what’s wrong). So, you call it like this:
User.new.from_json '{"id": 1, "name": "DHH"}' # RIGHT!
not like this:
User.from_json '{"id": 1, "name": "DHH"}' # WRONG!

