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