Module: MtkFramework::ActiveInteractionConcerns::UpdatableObject

Extended by:
ActiveSupport::Concern
Defined in:
lib/mtk_framework/active_interaction_concerns/updatable_object.rb

Instance Method Summary collapse

Instance Method Details

#update_object_from_filters(object, **options) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/mtk_framework/active_interaction_concerns/updatable_object.rb', line 8

def update_object_from_filters(object, **options)
  filters = self.class.filters.except(*options[:except])

  filters.each_key do |filter_name|
    if !send(filter_name).nil? && object.respond_to?("#{filter_name}=")
      object.send("#{filter_name}=", send(filter_name))
    end
  end
end