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