app/controllers/accounts_controller.rb
# check if user_info is given when create or update.
check if user_info is given when create or update.
check if user_info is given when create or update .
def before_put
    @put_method == :delete and return 
    receiver = @entity_ref.to_entity
    receiver.entity_id = @entity_ref.entity_id
    user = receiver.user_info
    if user.blank? || user.new_record?
      receiver.errors.add :user_info, "既存のユーザを指定してください．"
      fail ActiveRecord::RecordInvalid.new(receiver)
    end
  end
def before_put @put_method == :delete and return receiver = @entity_ref . to_entity receiver . entity_id = @entity_ref . entity_id user = receiver . user_info if user . blank? || user . new_record? receiver . errors . add :user_info , "既存のユーザを指定してください．" fail ActiveRecord :: RecordInvalid . new ( receiver ) end end
check if user_info is given when create or update.
check if user_info is given when create or update .
# do nothing