Sha256: 89244f1eaa42915f97ce934c97bc438aa7806fb3e1d33c027abaa18fbd4a5707

Contents?: true

Size: 548 Bytes

Versions: 1

Compression:

Stored size: 548 Bytes

Contents

module TokyoMetro::Factory::Seed::Reference::TrainOwner

  private

  def train_owner_in_db( whole = nil , search_by: @info.train_owner )
    if whole.present?
      whole.find_by_same_as( search_by )
    else
      ::TrainOwner.find_by_same_as( search_by )
    end
  end

  def train_owner_id( whole = nil , search_by: @info.train_owner )
    _train_owner_in_db = train_owner_in_db( whole , search_by: search_by )
    raise "Error: \"#{ search_by }\" does not exist in the database." if _train_owner_in_db.nil?
    _train_owner_in_db.id
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/factory/seed/reference/train_owner.rb