Sha256: f5ec15a770d4168f5e3a710107b986cd6686e68dfa649be70b999dad0376f5e2
Contents?: true
Size: 826 Bytes
Versions: 28
Compression:
Stored size: 826 Bytes
Contents
RailClass.class_eval do data_miner do process "Ensure CountryRailClass, CountryRailTractionClass, and RailCompanyTractionClass are populated" do CountryRailTractionClass.run_data_miner! CountryRailClass.run_data_miner! RailCompanyTractionClass.run_data_miner! end process "Derive rail class names from CountryRailClass, CountryRailTractionClass, and RailCompanyTractionClass" do names = [] names += CountryRailTractionClass.select("DISTINCT rail_class_name").map(&:rail_class_name) names += CountryRailClass.select("DISTINCT rail_class_name").map(&:rail_class_name) names += RailCompanyTractionClass.select("DISTINCT rail_class_name").map(&:rail_class_name) names.uniq.each do |name| RailClass.find_or_create_by_name(name) end end end end
Version data entries
28 entries across 28 versions & 1 rubygems