I am overriding to_json in my ActiveRecord class:
def to_json(options={})
puts options
options.merge :methods => [:shortened_id, :quote]
puts options
super(options)
end
It's not doing anything to the options hash, i.e. it's not changing it.
I am calling it via
obj.to_json
I call puts to see if it's modifying options hash and it prints
{}
{}
Also, i tried this with as_json, no luck. What's the difference between to_json and as_json and why isn't this working? Thanks!