lib/config_scripts/seeds/seed_set.rb
# This method reads the data for this seed set from its seed folder.
#
# @param [Boolean] reset
#   Whether we should reset the existing records before loading the seeds.
#
# It will load the data for each seed type's file, enclosing all the
# seed types in a transaction block.
This method reads the data for this seed set from its seed folder.
This method reads the data for this seed set from its seed folder .
def read(reset=false)
        folder_path = Rails.root.join('db', 'seeds', 'data', self.folder)
        FileUtils.mkdir_p(folder_path)
        puts "Reading seeds for #{self.name} from #{folder_path}"
        ActiveRecord::Base.transaction do
          self.reset_records if reset
          self.seed_types.each do |klass, seed_type|
            seed_type.read_from_folder(folder_path)
          end
        end
      end
def read ( reset = false ) folder_path = Rails . root . join ( 'db' , 'seeds' , 'data' , self . folder ) FileUtils . mkdir_p ( folder_path ) puts "Reading seeds for #{self.name} from #{folder_path}" ActiveRecord :: Base . transaction do self . reset_records if reset self . seed_types . each do | klass , seed_type | seed_type . read_from_folder ( folder_path ) end end end
This method reads the data for this seed set from its seed folder.
This method reads the data for this seed set from its seed folder .
reset
<not_specific>
<not_specific>
reset Whether we should reset the existing records before loading the seeds. It will load the data for each seed type's file, enclosing all the seed types in a transaction block.
reset Whether we should reset the existing records before loading the seeds . It will load the data for each seed type ' s file enclosing all the seed types in a transaction block .