Loads data from each fixture file in the extract set using
 ActiveRecord::Fixtures
962015
def load_into_database(options={})
      # necessary to make multiple invocations possible in a single test
      # case possible
      ActiveRecord::Fixtures.reset_cache

      # Filter down the models to load if specified
      the_tables = if options.has_key?(:only)
        self.table_names.select {|x| Array(options[:only]).map(&:to_s).include?(x) }
      elsif options.has_key?(:except)
        self.table_names.select {|x| !Array(options[:except]).map(&:to_s).include?(x) }
      else
        self.table_names
      end
      raise "No models to load, relax your :only or :except filters (or don't bother calling this method)" if the_tables.empty?


      #This wraps all the inserts into a single transaction allowing the constraint check to happen at the end.
      ActiveRecord::Base.transaction do

        the_tables.each do |table_name|
          class_name = if self.table_name_to_model_name_hash.kind_of?(Hash)
            self.table_name_to_model_name_hash[table_name]
          else
            ActiveSupport::Deprecation.warn "your fe_manifest.yml does not contain a table_name_to_model_name_hash (as found in 1.0.0 or earlier). Version 2.0.0 will require this. See test cases for how to manually jigger your fe_manifest.ymls to function."
            nil
          end
          if options[:map].nil?
            # Vanilla create_fixtures will work fine when no mapping is being used
            ActiveRecord::Fixtures.create_fixtures(self.target_path, table_name)
          else
            # Map table_name via a function (great for prefixing)
            new_table_name = if options[:map].kind_of?(Proc)
              options[:map].call(table_name)
            # Map table_name via a Hash table name mapping
            elsif options[:map][table_name].kind_of? String
              options[:map][table_name]
            else
              table_name # No mapping for this table name
            end
            fixtures = ActiveRecord::Fixtures.new( ActiveRecord::Base.connection,
                new_table_name,
                class_name,
                ::File.join(self.target_path, table_name))
            fixtures.table_rows.each do |the_table_name,rows|
              rows.each do |row|
                ActiveRecord::Base.connection.insert_fixture(row, the_table_name)
              end
            end
          end
          # FIXME: The right way to do this is to fork the oracle enhanced adapter
          # and implement a reset_pk_sequence! method, this is what ActiveRecord::Fixtures
          # calls.  aka this code should be eliminated/live elsewhere.
          case ActiveRecord::Base.connection.adapter_name
          when /oracle/i
            model = class_name.constantize
            if model.column_names.include? "id"
              sequence_name = model.sequence_name.to_s
              max_id = model.maximum(:id)
              next_id = max_id.nil? ? 1 : max_id.to_i + 1
              begin
                ActiveRecord::Base.connection.execute("drop sequence #{sequence_name}")
              rescue
                puts "[Iron Fixture Extractor] WARNING: couldnt drop the sequence #{sequence_name}, (but who cares!)"
              end
              begin
                q="create sequence #{sequence_name} increment by 1 start with #{next_id}"
                ActiveRecord::Base.connection.execute(q)
              rescue
                puts "[Iron Fixture Extractor] WARNING: couldnt create the sequence #{sequence_name}"
              end
            end
          else
            # Do nothing, only oracle adapters need this
          end
        end
      end # End transaction
    end
647172
def load(data)
      data.each do |key, value|
        check_key!(key)
        set(key, value)
      end
    end
592302
def to_hash
      load

      {}.tap do |hash|
        @_definition.each do |k, v|
          hash[k] = v
        end
      end
    end
812223
def save_fixture(file_name, content = rendered)
      fixture_path = File.join(Rails.root, FIXTURE_DIRECTORY, file_name)
      fixture_directory = File.dirname(fixture_path)
      FileUtils.mkdir_p fixture_directory unless File.exists?(fixture_directory)

      File.open(fixture_path, 'w') do |file|
        file.puts(content)
      end

      ignore_generated_fixtures
    end
35090
def load_extensions
    self.class.validate_path @extensions_path
    Dir[File.join(@extensions_path, '**', '*.rb').to_s].each { |f| load(f) }
  end
511925
def extract_and_merge_controller_data(data)
      if @controller
        data[:request] = {
          params:      @controller.request.parameters.to_hash,
          rails_root:  defined?(Rails) && defined?(Rails.root) ? Rails.root : "Rails.root not defined. Is this a test environment?",
          url:         @controller.complete_request_uri
        }
        data[:environment].merge!(@controller.request.env.to_hash)

        @controller.session[:fault_in_session]
        data[:session] = {
          key:         @controller.request.session_options[:id],
          data:        @controller.session.to_hash
        }
      end
    end
290070
def get_fixtures_file_hash(all_fixture_paths: Iterable[str]) -> str:
    
    hasher = hashlib.md5()
    for fixture_path in sorted(all_fixture_paths):
        with open(fixture_path, 'rb') as fixture_file:
            hasher.update(fixture_file.read())
    return hasher.hexdigest()
681316
protected function loadFixtureFiles()
    {
        foreach ($this->bundles as $bundle) {
            $file = '*';
            if (strpos($bundle, '/')) {
                list($bundle, $file) = explode('/', $bundle);
            }
            $path = $this->kernel->locateResource('@' . $bundle);
            $files = glob($path . $this->directory . '/'.$file.'.yml');
            $this->fixture_files = array_unique(array_merge($this->fixture_files, $files));
        }
    }
187628
def use_home_fixture(name)
      path = File.join spec_root, 'home_fixtures', name.to_s
      copy_fixture path, active_home_fixture_dir
      nil
    end
867804
def dump_cache_fixtures!
      responses.each do |cache_key, response|
        path = filepath_for(cache_key)
        unless File.exist?(path)
          File.open(path, "wb") do |fp|
            fp.write(Marshal.dump(response))
          end
        end
      end
    end
481502
def loadRecords(self, records):
        
        try:
            if self._running:
                return
            
            self._cancelled = False
            self._running = True
            
            try:
                self.setDatabase(records.database())
            except AttributeError:
                pass
            
            self.startLoading()
            
            # make sure the orb module is loaded, or there is really no point
            if RecordSet is None:
                logger.error('Orb was not loaded.')
            
            # lookup a group of results
            if RecordSet.typecheck(records) and records.groupBy():
                levels = records.groupBy()
                next_levels = levels[1:]
                
                for key, records in records.grouped(levels[0]).items():
                    if self._cancelled:
                        break
                    
                    # PySide Hack! Emitting None across threads will crash Qt
                    #              when in PySide mode.
                    if key == None:
                        key = 'None'
                    
                    self.loadedGroup.emit(key, records, next_levels)
            
            # lookup a list of results, in batched mode
            elif self.isBatched():
                self.loadBatch(records)
                
            # lookup a list of results, not in batched mode
            else:
                records = list(records)
                if self._preloadColumns:
                    for record in curr_records:
                        record.recordValues(self._preloadColumns)
                
                self.loadedRecords[object].emit(records)
            
            self._running = False
            self.finishLoading()
        except ConnectionLostError:
            self.finishLoading()
            self.connectionLost.emit()
        except Interruption:
            self.finishLoading()
        finally:
            self.finishLoading()
936859
def _load_from_yaml(self, filename: str, model_identifiers: Dict[str, List[str]]):
        
        class_name = filename[:filename.rfind('.')]
        rendered_yaml = self.env.get_template(filename).render(
            model_identifiers=model_identifiers)
        fixture_data, self.relationships[class_name] = self._post_process_yaml_data(
            yaml.load(rendered_yaml),
            self.factory.get_relationships(class_name))

        for identifier_key, data in fixture_data.items():
            self.model_fixtures[class_name][identifier_key] = data
860223
def load_relationship(name)
      populate_relationship(:parent, interface.parent)
      populate_relationship(:machine, interface.machine)
      populate_relationship(:children, interface.children)
    end
68044
def _load_data(self, data, from_db=False):
        
        self._data = data[:]
        self.setattrs(
            values=[],
            node_stack=[],
            node_dict={},
        )
        self._from_db = from_db
123916
def fetch(atom_names, start=false)
      atoms = ActiveSupport::OrderedHash.new

      atom_names.uniq.collect{|a| encoded_prefix(a) }.uniq.each do |prefix|
        pattern = @path.join(prefix.to_s).to_s
        pattern += '*' if start
        pattern += INDEX_FILE_EXTENSION

        Pathname.glob(pattern).each do |atom_file|
          atom_file.open do |f|
            atoms.merge!(Marshal.load(f))
          end
        end # Pathname.glob

      end # atom_names.uniq
      atoms
    end
1152607
def load_fixture(fixture_path: str,
                 fixture_key: str,
                 normalize_fn: Callable[..., Any]=identity) -> Dict[str, Any]:
    
    file_fixtures = load_json_fixture(fixture_path)
    fixture = normalize_fn(file_fixtures[fixture_key])
    return fixture
571
def load(attributes, remove_root=false)
      attributes = attributes ? attributes.stringify_keys : {}
      self.class.belongs_to_with_parents.each do |belongs_to_param|
        attributes["#{belongs_to_param}_id"] ||= prefix_options["#{belongs_to_param}_id".intern]

        # also set prefix attributes as real attributes. Otherwise,
        # belongs_to attributes will be stripped out of the response
        # even if we aren't actually using the association.
        @attributes["#{belongs_to_param}_id"] = attributes["#{belongs_to_param}_id"]
      end
      super(attributes, remove_root)
    end