Sha256: aad652405ac806b8a7dc1d34ebd7af8beaf6c61768d4b71c44afa113243cd3ac

Contents?: true

Size: 519 Bytes

Versions: 37

Compression:

Stored size: 519 Bytes

Contents

class Pulitzer::ContentElementsController::Update

  def initialize(content_element, params)
    @content_element, @params = content_element, params.to_h.to_hash.symbolize_keys
  end

  def call
    prune_params
    @content_element.update @params
  end

  def prune_params
    clickable_kind = @params.delete :clickable_kind
    custom_option_list = GlobalID::Locator.locate(clickable_kind)
    if custom_option_list.present?
      @params[:body] = nil
    else
      @params[:custom_option_id] = nil
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
pulitzer-0.15.11 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.10 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.9 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.8 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.7 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.6 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.5 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.4 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.3 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.2 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.1 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.0 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.14.4 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.14.3 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.14.2 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.14.1 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.14.0 app/interactions/pulitzer/content_elements_controller/update.rb