Sha256: bcd0b97d84a720ea50b5a73d3dc1f263a1200a1257759286ce359e8be5e19810

Contents?: true

Size: 515 Bytes

Versions: 19

Compression:

Stored size: 515 Bytes

Contents

class Pulitzer::PostTypesController::ImportVersion

  def initialize(post_type, params)
    @post_type, @params = post_type, params
    last_version_number = @post_type.post_type_versions.maximum(:version_number) || 0
    @this_version_number = last_version_number + 1
  end

  def call
    import_json = @params[:import_json].read
    ptv = @post_type.post_type_versions.build
    ptv.from_json import_json
    ptv.version_number = @this_version_number
    ptv.status = 'incomplete'
    ptv.save
    ptv
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
pulitzer-0.15.31 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.30 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.29 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.28 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.27 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.26 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.25 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.24 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.23 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.22 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.21 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.20 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.19 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.18 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.17 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.16 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.15 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.14 app/interactions/pulitzer/post_types_controller/import_version.rb
pulitzer-0.15.13 app/interactions/pulitzer/post_types_controller/import_version.rb