Sha256: cc058fa542c2a1757696a9faa65a48c88662e2719bffac837ad27821596fe3ae

Contents?: true

Size: 481 Bytes

Versions: 12

Compression:

Stored size: 481 Bytes

Contents

class Pulitzer::PartialTagsController::CreatePartialTag

  def initialize(params)
    @request_params = params
  end

  def call
    label_id = partial_tag_params[:label_id]
    unless (Integer(label_id) rescue false)
      tag = Pulitzer::Tag.where(name: label_id).first_or_create
      @request_params[:partial_tag][:label_id] = tag.id
    end
    Pulitzer::PartialTag.create partial_tag_params
  end

  def partial_tag_params
    @request_params[:partial_tag].permit!
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pulitzer-0.15.31 app/interactions/pulitzer/partial_tags_controller/create_partial_tag.rb
pulitzer-0.15.30 app/interactions/pulitzer/partial_tags_controller/create_partial_tag.rb
pulitzer-0.15.29 app/interactions/pulitzer/partial_tags_controller/create_partial_tag.rb
pulitzer-0.15.28 app/interactions/pulitzer/partial_tags_controller/create_partial_tag.rb
pulitzer-0.15.27 app/interactions/pulitzer/partial_tags_controller/create_partial_tag.rb
pulitzer-0.15.26 app/interactions/pulitzer/partial_tags_controller/create_partial_tag.rb
pulitzer-0.15.25 app/interactions/pulitzer/partial_tags_controller/create_partial_tag.rb
pulitzer-0.15.24 app/interactions/pulitzer/partial_tags_controller/create_partial_tag.rb
pulitzer-0.15.23 app/interactions/pulitzer/partial_tags_controller/create_partial_tag.rb
pulitzer-0.15.22 app/interactions/pulitzer/partial_tags_controller/create_partial_tag.rb
pulitzer-0.15.21 app/interactions/pulitzer/partial_tags_controller/create_partial_tag.rb
pulitzer-0.15.20 app/interactions/pulitzer/partial_tags_controller/create_partial_tag.rb