Sha256: c23db469e6fd2c3d5e4de32e2eb61f1b078d08908320b3986371d0383c5c6299

Contents?: true

Size: 480 Bytes

Versions: 3

Compression:

Stored size: 480 Bytes

Contents

class Pulitzer::PostTypeVersionsController::Create

  def initialize(params)
    @params = params.to_h.to_hash.symbolize_keys
  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
    CreateSingletonPost.new(@ptv).call
    @ptv
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pulitzer-0.15.2 app/interactions/pulitzer/post_type_versions_controller/create.rb
pulitzer-0.15.1 app/interactions/pulitzer/post_type_versions_controller/create.rb
pulitzer-0.15.0 app/interactions/pulitzer/post_type_versions_controller/create.rb