Sha256: 84fe356a061100d64e0c583c095d6cf19dd88993a57f413bdffb7b923f041842
Contents?: true
Size: 546 Bytes
Versions: 19
Compression:
Stored size: 546 Bytes
Contents
class Pulitzer::PostTypeVersionsController::ImportPost def initialize(post_type_version, params) @post_type_version, @params = post_type_version, params end def call import_json = @params[:import_json].read post = Pulitzer::Post.new post.from_json import_json post.post_type_version = @post_type_version if Pulitzer::Post.where(title: post.title).to_a.any?{|other_post| (other_post.post_type_version_id == post.post_type_version_id)} post.title += ' (cloned)' end post.save post end end
Version data entries
19 entries across 19 versions & 1 rubygems