#
#= banks モデル
# Authors:: Kazunori Shimizu
#--
# date        name                   note
# 2013.12.13   Kazunori Shimizu        新規登録
#-------------------------------------------------------------------------------
#++
class StockLocation < Comm::BaseModel::PermanentMaster
  def validate
    ars = StockLocation.disp_name_is(self.disp_name).valid.id_is_not(self.id)
    record_num = ars.length
    if record_num > 0
       ids = ars.collect{|ar| ar.id}
       emsg = ''
       emsg << EMJ0005
       emsg << "指定のロケーション名は既に登録されています。"
       emsg << "ID:"+ids.inspect
       raise UserOperationError, emsg
    end
  end
end
