| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
|/
|
|
|
|
|
|
|
|
| |
In the end I think the pain of implementing this seamlessly was not
worth the gain provided.
The intention was that it would allow plain ruby objects that might not
live in your main application to be subclassed and have persistence
mixed in. But I've decided that the benefit of doing that is not worth
the amount of complexity that the implementation introduced.
|
|
|
|
| |
deprecation message
|
| |
|
| |
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
We don't need separate @class_to_pool and @connection_pool hashes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve the derivation of HABTM join table name to take account of nesting.
It now takes the table names of the two models, sorts them lexically and
then joins them, stripping any common prefix from the second table name.
Some examples:
Top level models
(Category <=> Product)
Old: categories_products
New: categories_products
Top level models with a global table_name_prefix
(Category <=> Product)
Old: site_categories_products
New: site_categories_products
Nested models in a module without a table_name_prefix method
(Admin::Category <=> Admin::Product)
Old: categories_products
New: categories_products
Nested models in a module with a table_name_prefix method
(Admin::Category <=> Admin::Product)
Old: categories_products
New: admin_categories_products
Nested models in a parent model
(Catalog::Category <=> Catalog::Product)
Old: categories_products
New: catalog_categories_products
Nested models in different parent models
(Catalog::Category <=> Content::Page)
Old: categories_pages
New: catalog_categories_content_pages
Also as part of this commit the validity checks for HABTM assocations have
been moved to ActiveRecord::Reflection One side effect of this is to move when
the exceptions are raised from the point of declaration to when the association
is built. This is consistant with other association validity checks.
|
| |
|
|
|
|
|
|
| |
Rename some parameters and instance and local variables, mostly in fixtures.rb. Also remove an unused assignment to an instance variable.
There are minor code changes.
|
|
|
|
| |
Remove the unused private method ActiveRecord::Fixtures#yaml_fixtures_key(path).
|
|
|
|
| |
Second parameter of Fixtures::instantiate_fixtures was not used, so i removed it.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
mappings. Fixes an unintended regression.
|
| |
|
|
|
|
| |
unintended (and untested) regression.
|
|
|
|
|
|
| |
Renamed "fixture_name" to "accessor_name" and made fixture names in the form "admin/users" be used as the key for the hashes @fixture_cache and @loaded_fixtures.
Previously the variable "fixture_name" here was getting a value of the form "admin_user", and this value was then used as the hash key.
|
|
|
|
|
|
|
|
| |
Made the fixture's table name be taken from its model class whenever this class responds to table_name, instead of inferring it sometimes from the fixture's pass.
The previous behavior seemed buggy because it depended on whether the model class was passed as a constant or as a name string.
Improved Fixtures#initialize.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This solves an issue with set_fixture_class class method caused by create_fixtures method's overwriting passed to it fixture model classes, when the fixtures are "namespased": foo/bar or admin/users.
The idea is to use "foo/bar" string as the name and identifier of a
fixture file bar in directory foo. The model class of the fixture is either set with set_fixture_class method, or otherwise inferred from its name using camelize method.
Also a bug is fixed in lines 487-489 when the table names were guessed by substitution from the fixture file names, ambiguously called table_names, instead of being taken from fixture attributes. Now they are taken from attributes.
I plan to submit another fix so that the fixture's table name (for
example foo_bar) be defined by the fixture's model whenever possible,
instead of inferring it from the fixture's name ("foo/bar").
|
|
|
|
| |
Fixed a bug in fixtures.rb where the table name was incorrectly inferred from the fixture path which was ambiguously called "table_name" but was also used as the fixture name.
Now, the "correct" table name is taken from an instance variable.
|
| |
|
|
|
|
| |
from Ruby stdlib.
|
|
|
|
| |
during setup
|
| |
|
|
|
|
| |
You can use multiple databases in your tests without disabling transactional fixtures.
|
|
|
|
| |
This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07.
|
|
|
|
|
| |
If we don't have a primary key when we ask for it, it's better to fail
fast. Fixes GH #2307.
|
|
|
|
| |
link in fixture template [closes #2840]
|
| |
|
| |
|
|\ |
|
| | |
|
|\ \
| |/
|/|
| |
| |
| | |
Conflicts:
actionmailer/lib/action_mailer/base.rb
activesupport/lib/active_support/core_ext/kernel/requires.rb
|
| | |
|
| |
| |
| |
| | |
as per the last version of the yml specifications : http://www.yaml.org/spec/1.2/spec.html#* alias//
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|