Sha256: 1b59df2c11dfadea3326102271def5bbde6f57bcf3f2aa7373f42cfa2132acf8
Contents?: true
Size: 442 Bytes
Versions: 14
Compression:
Stored size: 442 Bytes
Contents
class Pulitzer::CreateSingletonPost attr_accessor :post_type_version, :title def initialize(post_type_version) self.post_type_version = post_type_version self.title = post_type_version.name end def call if post_type_version.singular? && !post_type_version.posts.any? singleton_post = post_type_version.posts.create(title: title) Pulitzer::CreatePostContentElements.new(singleton_post).call end end end
Version data entries
14 entries across 13 versions & 1 rubygems