aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/fixtures.rb
Commit message (Collapse)AuthorAgeFilesLines
* reverse comparison because of strange AS behaviorAaron Patterson2013-05-211-1/+1
| | | | http://tenderlovemaking.com/2013/05/21/one-danger-of-freedom-patches.html
* stop depending on callbacksAaron Patterson2013-04-041-6/+12
|
* Allows setting fixture_path to a PathnameAlexander Murmann and Can Berk Güder2013-03-211-1/+1
|
* fix example of setting DEFAULTS in fixturesJonathan Garvin2013-01-161-2/+2
|
* These are already required through AS/railsAkira Matsuda2013-01-071-2/+0
| | | | | | * dependencies/autoload * concern * deprecation
* Fix argument name in fixtures methodCarlos Antonio da Silva2012-12-181-1/+1
| | | | Relatedo to 8e44c93b4c0e4b1bdd0fca13b79f5be1088d6959.
* Revert "use File.basename to get the filename minus .yml"Aaron Patterson2012-12-181-4/+3
| | | | | | | This reverts commit 00c5342d96a3677c0a6a2bb8316c76182f5bdfdd. Conflicts: activerecord/lib/active_record/fixtures.rb
* Remove useless check of AR being defined from teardown fixturesCarlos Antonio da Silva2012-11-271-5/+4
| | | | | | | 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.
* Add a deprecation before removing find_table_nameAlexey Muranov2012-11-171-0/+6
| | | 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.
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-171-2/+2
|\ | | | | | | | | Conflicts: actionpack/lib/action_dispatch/routing/redirection.rb
| * 1.9 Syntax related changesAvnerCohen2012-11-101-2/+2
| |
* | Properly deprecate ConnectionHandler#connection_poolsJon Leighton2012-11-091-1/+1
|/ | | | | | | | Rather than just changing it and hoping for the best. Requested by @jeremy: https://github.com/rails/rails/commit/ba1544d71628abff2777c9c514142d7e9a159111#commitcomment-2106059
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-031-0/+1
|\ | | | | | | | | | | | | Conflicts: actionpack/lib/action_controller/metal/mime_responds.rb activerecord/lib/active_record/attribute_methods.rb guides/source/working_with_javascript_in_rails.md
| * nodoc deprecated AR::Fixtures constant [ci skip]Francesco Rodriguez2012-10-211-0/+1
| |
* | Remove ActiveRecord::ModelJon Leighton2012-10-261-1/+1
|/ | | | | | | | | | 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.
* Remove the leading :: constant qualifier in the ActiveRecord::Fixtures ↵Jeremy Kemper2012-10-101-1/+1
| | | | deprecation message
* Move/rename files to follow naming conventionsAlexey Muranov2012-10-071-1/+1
|
* Deprecate "Fixtures" constantAlexey Muranov2012-10-071-0/+8
|
* Rename "Fixtures" class to "FixtureSet"Alexey Muranov2012-10-071-17/+17
| | | | 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.
* Move transaction joinability into the transaction objectJon Leighton2012-09-151-3/+2
|
* Start to tease out transaction handling into a state machineJon Leighton2012-09-151-6/+2
|
* One hash is enoughJon Leighton2012-08-311-1/+1
| | | | We don't need separate @class_to_pool and @connection_pool hashes.
* load active_support/core_ext/object/blank in active_support/railsXavier Noria2012-08-021-1/+0
|
* Improve the derivation of HABTM assocation join table namesAndrew White2012-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix an error in example in methods of instanciated fixtures.Geoffrey Roguelon2012-05-151-1/+1
|
* Rename some variablesAlexey Muranov2012-05-091-76/+80
| | | | | | 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 unused private method in fixtures.rbAlexey Muranov2012-05-091-3/+0
| | | | Remove the unused private method ActiveRecord::Fixtures#yaml_fixtures_key(path).
* Remove unused parameter in ::instantiate_fixturesAlexey Muranov2012-05-091-5/+5
| | | | Second parameter of Fixtures::instantiate_fixtures was not used, so i removed it.
* Change unless + ! into ifPiotr Sarnacki2012-05-041-1/+1
|
* properly namespace the fixture exceptionAaron Patterson2012-03-221-6/+2
|
* Remove IdentityMapCarlos Antonio da Silva2012-03-131-3/+1
|
* Refactored the OrderedHash related stuffRaghunadh2012-02-091-2/+1
|
* Remove Array.wrap calls in ActiveRecordRafael Mendonça França2012-01-061-2/+1
|
* No need to require psych since require yaml does that.Rafael Mendonça França2012-01-041-1/+0
|
* No need to use rescue block to require psychRafael Mendonça França2012-01-041-6/+1
|
* create_fixtures should accept symbol keys for custom table -> class ↵Jeremy Kemper2012-01-031-2/+4
| | | | mappings. Fixes an unintended regression.
* use File.basename to get the filename minus .ymlAaron Patterson2012-01-031-2/+3
|
* setup_fixture_accessors should accept symbols for table names. Fixes an ↵Jeremy Kemper2012-01-031-0/+1
| | | | unintended (and untested) regression.
* Fixes for TestFixtures::setup_fixture_accessorsAlexey Muranov2011-12-301-6/+5
| | | | | | 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.
* Fixture's table name be defined in the modelAlexey Muranov2011-12-301-10/+17
| | | | | | | | 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.
* Use foo/bar instead of foo_bar keys for fixturesAlexey Muranov2011-12-301-12/+25
| | | | | | | | | | | | | 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").
* Use the correct table name from fixtureAlexey Muranov2011-12-281-2/+2
| | | | 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.
* Fixtures support for ActiveRecord::ModelJon Leighton2011-12-241-1/+1
|
* * BufferedLogger is deprecated. Use ActiveSupport::Logger, or the loggerAaron Patterson2011-12-191-1/+0
| | | | from Ruby stdlib.
* ensure @fixture_connections is initialized in case an exception happens ↵Aaron Patterson2011-12-101-0/+1
| | | | during setup
* Errno::ENOENT error makes more sense when a file cannot be foundAaron Patterson2011-12-101-10/+0
|
* Transactional fixtures enlist all active database connections.Jeremy Kemper2011-10-051-6/+18
| | | | You can use multiple databases in your tests without disabling transactional fixtures.
* Revert "Raise error on unknown primary key."Jon Leighton2011-10-051-1/+1
| | | | This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07.
* Raise error on unknown primary key.Jon Leighton2011-10-051-1/+1
| | | | | If we don't have a primary key when we ask for it, it's better to fail fast. Fixes GH #2307.
* restores the API docs of AR::Fixtures, made a quick pass over them, revises ↵Xavier Noria2011-09-031-368/+361
| | | | link in fixture template [closes #2840]