Sha256: 5fc4fe55fba04527c1be1b86955e8c7027ec6c094e14021fcd305d55eb64bf7a

Contents?: true

Size: 492 Bytes

Versions: 8

Compression:

Stored size: 492 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
    ::Pulitzer::CreateSingletonPost.new(@ptv).call
    @ptv
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pulitzer-0.15.10 app/interactions/pulitzer/post_type_versions_controller/create.rb
pulitzer-0.15.9 app/interactions/pulitzer/post_type_versions_controller/create.rb
pulitzer-0.15.8 app/interactions/pulitzer/post_type_versions_controller/create.rb
pulitzer-0.15.7 app/interactions/pulitzer/post_type_versions_controller/create.rb
pulitzer-0.15.6 app/interactions/pulitzer/post_type_versions_controller/create.rb
pulitzer-0.15.5 app/interactions/pulitzer/post_type_versions_controller/create.rb
pulitzer-0.15.4 app/interactions/pulitzer/post_type_versions_controller/create.rb
pulitzer-0.15.3 app/interactions/pulitzer/post_type_versions_controller/create.rb