| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ |
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
Fixture files are passed through an ERB renderer before being read as
YAML. The rendering is currently done in the context of the main object,
so method definitons leak into other fixtures, and there is no clean
place to define fixture helpers.
After this commit, the ERB renderer will use a new subclass of
ActiveRecord::FixtureSet.context_class each time a fixture is rendered.
|
| |
|
| |
|
| |
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
`ActiveRecord::Fixtures.default_fixture_model_name`.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
http://tenderlovemaking.com/2013/05/21/one-danger-of-freedom-patches.html
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* dependencies/autoload
* concern
* deprecation
|
|
|
|
| |
Relatedo to 8e44c93b4c0e4b1bdd0fca13b79f5be1088d6959.
|
|
|
|
|
|
|
| |
This reverts commit 00c5342d96a3677c0a6a2bb8316c76182f5bdfdd.
Conflicts:
activerecord/lib/active_record/fixtures.rb
|
|
|
|
|
|
|
| |
We are already in the AR namespace, there's no way for it to be
undefined. See the cousin commit 13e72db77063f57c3028a906690d42fb068845bb
Refactor a bit teardown fixtures to avoid two conditionals.
|
|
|
| |
The `ActiveRecord::Fixtures::find_table_name` method was removed from "master" almost a year ago, but it was never deprecated. Here it comes back, more dead than alive.
|
|\
| |
| |
| |
| | |
Conflicts:
actionpack/lib/action_dispatch/routing/redirection.rb
|
| | |
|
|/
|
|
|
|
|
|
| |
Rather than just changing it and hoping for the best.
Requested by @jeremy:
https://github.com/rails/rails/commit/ba1544d71628abff2777c9c514142d7e9a159111#commitcomment-2106059
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
actionpack/lib/action_controller/metal/mime_responds.rb
activerecord/lib/active_record/attribute_methods.rb
guides/source/working_with_javascript_in_rails.md
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
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.
|