instance method read_csv_fixture_files

Ruby on Rails 3.1.12

Since v3.1.12 Last seen in v3.1.12 Private — implementation detail, not part of the public API

Signature

read_csv_fixture_files()

No documentation comment.

Source
# File activerecord/lib/active_record/fixtures.rb, line 684
      def read_csv_fixture_files
        reader = CSV.parse(erb_render(IO.read(csv_file_path)))
        header = reader.shift
        i = 0
        reader.each do |row|
          data = {}
          row.each_with_index { |cell, j| data[header[j].to_s.strip] = cell.to_s.strip }
          fixtures["#{@class_name.to_s.underscore}_#{i+=1}"] = ActiveRecord::Fixture.new(data, model_class)
        end
      end

Defined in activerecord/lib/active_record/fixtures.rb line 684 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Fixtures

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close