| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Auto-generate stable fixture UUIDs on PostgreSQL
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/fixtures.rb
activerecord/test/cases/adapters/postgresql/uuid_test.rb
activesupport/CHANGELOG.md
|
| |
| |
| |
| | |
Fixes: #11524
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Restore the 4.0 behaviour for 'sqlite3:///', but deprecate it. We'll
change to the absolute-path interpretation in 4.2.
The current "correct" spellings for in-memory, relative, and absolute
URLs, respectively, are:
sqlite3::memory:
sqlite3:relative/path
sqlite3:/full/path
Substantially reverses/defers fbb79b517f3127ba620fedd01849f9628b78d6ce.
Uncovered by @guilleiguaran while investigating #14495, though that
sounds like a different issue.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Allows fixtures to use their $LABEL as part of a string instead
of limiting use to the entire value.
mark:
first_name: $LABEL
username: $LABEL1973
email: $LABEL@$LABELmail.com
users(:mark).first_name # => mark
users(:mark).username # => mark1973
users(:mark).email # => mark@markmail.com
|
|/ |
|
|
|
|
| |
FoxyFixturesTest#test_ignores_belongs_to_symbols_if_association_and_foreign_key_are_named_the_same
|
|
|
|
|
|
|
|
|
|
|
| |
Stubbing ENV[] is not safe outside MRI. At some point after the
stubbing has occurred a backtrace is printed to the ActiveSupport
warning log: there Rubinius accesses ENV['RBX_NOCOLOR'] to determine
if it should print the backtrace with colors or not, causing the
stub to fail. Other implementations might access ENV in a different
way too, we just can't predict it.
The only thing we can do here is to actually set the ENV with what
we want and restore it afterwards.
|
| |
|
| |
|
|
|
|
| |
not class names
|
| |
|
|
|
|
|
|
|
| |
Allows you to change your configuration for calls to
`table_name_prefix`, `table_name_suffix`, and `pluralize_table_names`.
The default configuration is still ActiveRecord::Base, but you are now
able to change the configuration easily.
|
|
|
|
|
|
|
| |
Also, constantizing the default_fixture_model_name when it gets loaded
in from the file. Later, when the class_name is passed to a new
FixtureSet, a deprecation warning will occur if the class_name is a
string.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
As you can also configure your database connection using `ENV["DATABASE_URL"]`,
the fixture setup can't reply on the `.configurations` Hash.
As the fixtures are only loaded when ActiveRecord is actually used
(`rails/test_help.rb`) it should be safe to drop the check for an existing configuration.
|
| |
|
|
|
|
|
| |
This allows end-users to have a `connection` method on their models
without clashing with ActiveRecord internals.
|
|
|
|
|
| |
This reverts commit 637a7d9d357a0f3f725b0548282ca8c5e7d4af4a, reversing
changes made to 5937bd02dee112646469848d7fe8a8bfcef5b4c1.
|
| |
|
|
|
|
| |
Rename `ActiveRecord::Fixtures` class to `ActiveRecord::FixtureSet`. Instances of this class normally hold a collection of fixtures (records) loaded either from a single YAML file, or from a file and a folder with the same name. This change make the class name singular and makes the class easier to distinguish from the modules like `ActiveRecord::TestFixtures`, which operates on multiple fixture sets, or `DelegatingFixtures`, `::Fixtures`, etc., and from the class `ActiveRecord::Fixture`, which corresponds to a single fixture.
|
| |
|
| |
|
|
|
|
|
|
| |
require model"
This reverts commit 7381596ea32aff47222af89e4bc66000f4597acb.
|
| |
|
| |
|
|
|
|
| |
mappings. Fixes an unintended regression.
|
|
|
|
| |
unintended (and untested) regression.
|
| |
|
|
|
|
|
|
| |
Test using fixtures with random names and model names, that is not following naming conventions but using set_fixture_class instead.
It is expected that the table name be defined in the model, but this is not explicitly tested here. This will need to be fixed.
|
|
|
|
| |
Make sure the table name of a model is reset in a test case after assigning ActiveRecord::Base.table_name_prefix and ActiveRecord::Base.table_name_suffix.
|
| |
|
|
|
|
|
|
|
|
|
| |
alexeymuranov/my_fix_for_prefix_suffix_fixtures_test"
This reverts commit f8e484d0f71114675ed04e987914d3f2815cb868, reversing
changes made to fa5adfb1e884bf21a7071ade634a820e37ac4db4.
Reason: broke the postgres tests.
|
|
|
| |
Make sure the table name of a model is reset in a test case after assigning ActiveRecord::Base.table_name_prefix and ActiveRecord::Base.table_name_suffix. This was somebody else's test case, so an independent opinion on the change can be helpful.
|
| |
|
|
|
|
|
|
| |
test_broken_yaml_exception in fixtures_test.rb on Ruby 1.8.7.
Cherry-pick from 3-1-stable: b8d46924e70e0847e92e1d2dbaaec8c11381072c
|
|
|
|
| |
You can use multiple databases in your tests without disabling transactional fixtures.
|
| |
|
|
|
|
| |
is 00:50 GMT+1. Without the quoting, the YAML parser would parse this as 00:50 UTC, into the local time of 01:50 GMT+1. Then, it would get written into the database in local time as 01:50. When it came back out the UTC date from the database and the UTC date of two weeks ago would be compared. The former would be 23:50, and the latter would be 00:50, so the two dates would differ, causing the assertion to fail. Quoting it prevents the YAML parser from getting involved.
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
[Fixes #439]
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|