Sha256: 1a6ee2dae1c2e02e9e364cbee71ef14359f3002558d54a89b8773d2718107412
Contents?: true
Size: 519 Bytes
Versions: 15
Compression:
Stored size: 519 Bytes
Contents
module Blogo class CreatePostService < BasePostService attr_reader :post def initialize(user, params) @post = user.posts.build @tags_string = params.delete(:tags_string) @post_attrs = params end def create! assign_attributes return false unless @post.valid? @post.transaction do @post.save! set_tags!(@tags_string) # Save tags_string # TODO: fix to have 1 save @post.save! end true end end end
Version data entries
15 entries across 15 versions & 1 rubygems