Sha256: 4a9a0a4b008a9279d306575bddb9a6702dda1c2435b8c0c394e3a16fe118f450
Contents?: true
Size: 639 Bytes
Versions: 3
Compression:
Stored size: 639 Bytes
Contents
module ForestLiana class ResourceUpdater attr_accessor :record def initialize(resource, params) @resource = resource @params = params end def perform @record = @resource.find(@params[:id]) if has_strong_parameter @record.update_attributes!(resource_params) else @record.update_attributes!(resource_params, without_protection: true) end end def resource_params ResourceDeserializer.new(@resource, @params[:resource], false).perform end def has_strong_parameter @resource.instance_method(:update_attributes!).arity == 1 end end end
Version data entries
3 entries across 3 versions & 1 rubygems