mirror of
https://github.com/github/rails.git
synced 2026-01-09 14:48:01 -05:00
Load fixtures from linked folders
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
## unreleased ##
|
||||
|
||||
* Load fixtures from linked folders.
|
||||
|
||||
*Kassio Borges*
|
||||
|
||||
* When using optimistic locking, `update` was not passing the column to `quote_value`
|
||||
to allow the connection adapter to properly determine how to quote the value. This was
|
||||
affecting certain databases that use specific colmn types.
|
||||
|
||||
@@ -661,7 +661,7 @@ module ActiveRecord
|
||||
end
|
||||
|
||||
def read_fixture_files
|
||||
yaml_files = Dir["#{@fixture_path}/**/*.yml"].select { |f|
|
||||
yaml_files = Dir["#{@fixture_path}/{**,*}/*.yml"].select { |f|
|
||||
::File.file?(f)
|
||||
} + [yaml_file_path]
|
||||
|
||||
@@ -752,7 +752,7 @@ module ActiveRecord
|
||||
|
||||
def fixtures(*fixture_names)
|
||||
if fixture_names.first == :all
|
||||
fixture_names = Dir["#{fixture_path}/**/*.{yml}"]
|
||||
fixture_names = Dir["#{fixture_path}/{**,*}/*.{yml}"]
|
||||
fixture_names.map! { |f| f[(fixture_path.size + 1)..-5] }
|
||||
else
|
||||
fixture_names = fixture_names.flatten.map { |n| n.to_s }
|
||||
|
||||
@@ -549,7 +549,7 @@ class LoadAllFixturesTest < ActiveRecord::TestCase
|
||||
fixtures :all
|
||||
|
||||
def test_all_there
|
||||
assert_equal %w(developers people tasks), fixture_table_names.sort
|
||||
assert_equal %w(admin/accounts admin/users developers people tasks), fixture_table_names.sort
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
1
activerecord/test/fixtures/all/admin
vendored
Symbolic link
1
activerecord/test/fixtures/all/admin
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../admin/
|
||||
Reference in New Issue
Block a user