Sha256: 227448da2125211dd6acacff5fc4a5384bdd81a8ccdfd2ca878fa19eac21696b

Contents?: true

Size: 769 Bytes

Versions: 59

Compression:

Stored size: 769 Bytes

Contents

class RailsOps::Operation::Model::Update < RailsOps::Operation::Model::Load
  model_authorization_action :update

  # As this operation might extend the model class, we need to make sure that
  # the operation works using an extended 'copy' of the given model class.
  def self.always_extend_model_class?
    true
  end

  def model_authorization
    return unless authorization_enabled?

    unless load_model_authorization_action.nil?
      authorize_model_with_authorize_only! load_model_authorization_action, model
    end

    unless model_authorization_action.nil?
      authorize_model! model_authorization_action, model
    end
  end

  def build_model
    super
    build_nested_model_ops :update
    assign_attributes
  end

  def perform
    save!
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
rails_ops-1.0.3 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.2 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.1 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta15 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta14 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta13 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta12 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta11 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta10 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta9 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta8 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta7 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta6 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta5 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta4 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta3 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta2 lib/rails_ops/operation/model/update.rb
rails_ops-1.0.0.beta1 lib/rails_ops/operation/model/update.rb