Re: wrap_parameters and Single Table Inheritance

26 views
Skip to first unread message

Max Shytikov

unread,
Nov 14, 2012, 1:03:19 PM11/14/12
to rubyonra...@googlegroups.com
Hi Christopher,

You can try this for example

wrap_parameters Entity, :include =>(Person.attribute_names + Group.attribute_names), :format => :json



On Thursday, November 8, 2012 2:07:33 AM UTC+2, Christopher Thielen wrote:
I'm using wrap_parameters and ActiveRecord's single table inheritance pattern.

I have a base class "Entity", and two types derived from it: "Person" and "Group".

What I'd like to do is PUT a Person or Group object to EntityController#update.

Unfortunately, this causes wrap_parameters to wrap for type "Entity" instead of Person or Group.

Is there a way to programmatically change wrap_parameter, e.g. so I can establish a before_filter that sets the proper child class name based on params[:type]?
Reply all
Reply to author
Forward
0 new messages