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.31 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.30 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.29 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.28 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.27 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.26 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.25 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.24 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.23 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.22 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.21 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.20 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.19 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.18 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.17 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.16 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.15 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.14 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.13 app/interactions/pulitzer/content_elements_controller/update.rb
pulitzer-0.15.12 app/interactions/pulitzer/content_elements_controller/update.rb