Sha256: b25493bb72f23e48991d33c7f58efbeb9c5af5e9b1913653ccdf45f23d97c986
Contents?: true
Size: 437 Bytes
Versions: 94
Compression:
Stored size: 437 Bytes
Contents
class Pulitzer::CreatePostTag def initialize(params) @request_params = params end def call label_id = post_tag_params[:label_id] unless (Integer(label_id) rescue false) tag = Pulitzer::Tag.where(name: label_id).first_or_create @request_params[:post_tag][:label_id] = tag.id end Pulitzer::PostTag.create post_tag_params end def post_tag_params @request_params[:post_tag].permit! end end
Version data entries
94 entries across 94 versions & 1 rubygems