Sha256: 7e8f7432c4435dd61246ccda091f2ea7219961c988dfb4807cfda35ae9f52c75
Contents?: true
Size: 558 Bytes
Versions: 21
Compression:
Stored size: 558 Bytes
Contents
class Pulitzer::PostTypeVersionsController::Create def initialize(params, create_post=true) @params = params.to_h.to_hash.symbolize_keys @create_post = create_post end def call @ptv = Pulitzer::PostTypeVersion.new(@params) @post_type = @ptv.post_type last_version_number = @post_type.post_type_versions.maximum(:version_number) || 0 this_version_number = last_version_number + 1 @ptv.version_number = this_version_number @ptv.save ::Pulitzer::CreateSingletonPost.new(@ptv).call if @create_post @ptv end end
Version data entries
21 entries across 21 versions & 1 rubygems