Class: FixtureBuilder::FixturesPath

Inherits:
Object
  • Object
show all
Defined in:
lib/fixture_builder/fixtures_path.rb

Class Method Summary collapse

Class Method Details

.absolute_rails_fixtures_pathObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/fixture_builder/fixtures_path.rb', line 3

def self.absolute_rails_fixtures_path
  File.expand_path(ActiveRecord::Tasks::DatabaseTasks.fixtures_path)
rescue
  if ENV["FIXTURES_PATH"]
    ENV["FIXTURES_PATH"]
  elsif File.exist?(File.expand_path("spec/fixtures",::Rails.root))
    File.expand_path("spec/fixtures",::Rails.root)
  else
    File.expand_path("test/fixtures",::Rails.root)
  end
end