I suggested this last week (I think?). We could use a transient object that
carries all of the attributes of the original (using an openstruct
perhaps?).
On Jul 25, 2013 9:35 AM, "Dominic Cleal" <notifications@github.com> wrote:

> In app/controllers/puppetclasses_controller.rb:
>
> >        end
> > -      @host.attributes = params['host']
>
> @isratrade <https://github.com/isratrade> I agree entirely, we need to
> find a middle ground, which I think means either whitelisting or
> blacklisting attributes, since mass assignment via attributes= is causing
> database updates (the original issue, of course).
>
> I think the list of attributes that can cause a change will be rather long
> - consider that global parameters can come from things like domain, OS and
> host group. Smart class parameters will be affected by selected puppet
> classes, environment and taxonomies (though not the puppetmaster,
> interestingly).
>
> And of course, some of those are associations (like puppet classes) that
> might cause database updates when we set them, so I'm not sure how you'd
> solve that if you updated them?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/theforeman/foreman/pull/786/files#r5393114>
> .
>