[Rails] Re: serializable_hash and serializable_add_includes

2012-01-25 Thread Jacob H.
Peter Vandenabeele wrote in post #1042445: > On Wed, Jan 25, 2012 at 7:35 AM, Jacob H. wrote: > >> >> model1.to_json(:include => {:model2 => {:only => >> [:some_other_property]}, :only => [:id]) >> >> Can someone please explain to me why it

[Rails] serializable_hash and serializable_add_includes

2012-01-24 Thread Jacob H.
I'm trying to write a helper method similar to attr_accessible but instead it will be used to whitelist which attributes are available for serialization (attr_serializable). My first attempt at this was to override serialized_hash and modify the :only option to include nothing but serializable att