app/controllers/runs_controller.rb
# general put of Universal_Attribute value of params
general put of Universal_Attribute value of params
general put of Universal_Attribute value of params
def put(params_for_entity = params[Universal_Attribute])
    @current_user or fail "put action is limited only for identified users to use."
    @entity_ref = params_for_entity.to_entity_ref
    @put_method =
      if params[:put_method] == "delete"
        @entity_ref.content[Run::Deleted_by] == @current_user.run_id.to_s or return 
        :delete
      else
       @entity_ref.new? ? :create : :update
      end
    Run.transaction do
      respond_to?(:before_put, true) and before_put()  
      @entity = @entity_ref.put
      flash_now @entity.blank?, "すでに削除されています．"
      @entity && respond_to?(:after_put, true)  and after_put()   
      @entity && !@entity.set_of_all_errors.blank? and fail ActiveRecord::RecordInvalid.new(@entity)
    end
    @entity
  end
def put ( params_for_entity = params [ Universal_Attribute ] ) @current_user or fail "put action is limited only for identified users to use." @entity_ref = params_for_entity . to_entity_ref @put_method = if params [ :put_method ] == "delete" @entity_ref . content [ Run :: Deleted_by ] == @current_user . run_id . to_s or return :delete else @entity_ref . new? ? :create : :update end Run . transaction do respond_to? ( :before_put , true ) and before_put ( ) @entity = @entity_ref . put flash_now @entity . blank? , "すでに削除されています．" @entity && respond_to? ( :after_put , true ) and after_put ( ) @entity && ! @entity . set_of_all_errors . blank? and fail ActiveRecord :: RecordInvalid . new ( @entity ) end @entity end
general put of Universal_Attribute value of params
general put of Universal_Attribute value of params
# do nothing for illegal action. # "true" means to allow private method. # preprocessing for put # postprocessing for put # check validity errors with @entity
params_for_entity
<not_specific>
params
<not_specific>