[image-management-engine] Model associations and controllers (#20)

Martyn Taylor mtaylor at redhat.com
Thu Sep 27 11:06:21 UTC 2012


On 09/27/2012 10:40 AM, mtaylor wrote:
>
> In app/models/image_management/provider_image.rb:
>
> >
> > -    accepts_nested_attributes_for :target_image
> > +    # FIXME Check to see if this is a setting we can add to Rails configuration.
> > +    # i.e. json_include_resource_name = true
>
> Thanks. I'll remove those methods and update the config.
>
>> Reply to this email directly or view it on GitHub 
> <https://github.com/aeolus-incubator/image-management-engine/pull/20/files#r1704794>. 
>
>
It seems that github does not send a mail when a comment is updated.  In 
case you are following comments in mail I've pasted my updated comment 
below:

Thanks. I'll remove those methods and update the config.


      Comment 2

After a little more consideration, I'm not sure we want to set this in 
the config. The setting is on ActiveRecord::Base and therefore would 
override any settings in the host application. I am going to leave this 
as it is for now and follow this up later with a patch. We could 
implement this using this setting but by either:

  *

    Setting this in the controller using: e.g. user.as_json(root: false)

  *

    Adding another class in the chain that will be used for any
    ActiveRecord settings specific to ImageManagement. For example:

class ImageManagement::Base < ActiveRecord::Base
include_root_in_json = false
end

class ImageManagement::TargetImage < ImageManagement::Base
...

What are your thoughts?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/aeolus-devel/attachments/20120927/b480be8c/attachment.html>


More information about the aeolus-devel mailing list