1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/fixtures
Andrew White 46492949b8 Improve the derivation of HABTM assocation join table names
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.
2012-06-22 06:27:11 +01:00
..
admin Fix backward compatibility with stored Hash values. Wrap coders to convert serialized values to indifferent access. 2012-05-30 23:21:57 -07:00
all deprecating CSV fixture support 2011-05-10 11:08:18 -07:00
categories
naked
reserved_words Improve the derivation of HABTM assocation join table names 2012-06-22 06:27:11 +01:00
.gitignore
accounts.yml
author_addresses.yml
author_favorites.yml
authors.yml
binaries.yml
books.yml
cars.yml
categories.yml
categories_ordered.yml fixing 1.8 support for new fixture tests 2011-05-23 15:06:13 -07:00
categories_posts.yml
categorizations.yml
clubs.yml
collections.yml
colleges.yml added test for #3732 2012-02-10 17:35:22 -05:00
comments.yml
companies.yml Associations: DRY up the code which is generating conditions, and make it all use arel rather than SQL strings 2010-12-26 19:38:04 +00:00
computers.yml
courses.yml added test for #3732 2012-02-10 17:35:22 -05:00
customers.yml
dashboards.yml
developers.yml Replaced all 'for' loops with Enumerable#each 2012-01-30 03:15:49 +08:00
developers_projects.yml
dog_lovers.yml Fix bug where reset_counters resets the wrong counter cache. 2012-01-16 19:06:45 -08:00
dogs.yml Fix bug where reset_counters resets the wrong counter cache. 2012-01-16 19:06:45 -08:00
edges.yml
entrants.yml
essays.yml
faces.yml
fk_test_has_fk.yml
fk_test_has_pk.yml
funny_jokes.yml
interests.yml
items.yml
jobs.yml
legacy_things.yml
mateys.yml Namespace Fixtures in ActiveRecord 2011-05-07 14:20:51 -06:00
member_details.yml
member_types.yml
members.yml
memberships.yml Don't use select() values from the join model of a through association. Fixes #508. 2011-05-11 08:56:01 +01:00
men.yml
minimalistics.yml
minivans.yml
mixed_case_monkeys.yml
mixins.yml
movies.yml
organizations.yml
other_topics.yml Fix a fixtures test case with table prefix/suffix 2011-12-27 02:17:31 +01:00
owners.yml
parrots.yml properly reference yml alias nodes 2011-05-24 11:18:28 +02:00
parrots_pirates.yml Namespace Fixtures in ActiveRecord 2011-05-07 14:20:51 -06:00
people.yml
peoples_treasures.yml Tests for removing a HABTM association when optimistic locking is enabled. 2012-03-07 23:56:23 -05:00
pets.yml
pirates.yml Quote these dates to prevent intermittent test failure. Suppose local time 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. 2011-08-04 00:38:27 +01:00
posts.yml Merge branch 'master' into nested_has_many_through 2011-03-04 09:30:27 +00:00
price_estimates.yml
products.yml
projects.yml
randomly_named_a9.yml Test fixtures with custom model and table names 2011-12-30 10:34:01 +01:00
ratings.yml
readers.yml
references.yml
ships.yml has_one should always remove the old record (properly), even if not saving the new record, so we don't get the database into a pickle 2011-01-11 13:45:06 -08:00
speedometers.yml
sponsors.yml
string_key_objects.yml Don't quote ID's as Arel will quote them -- follow same conventions as the delete method. 2011-05-08 18:37:28 +01:00
subscribers.yml
subscriptions.yml
taggings.yml Add a test for STI on the through where the through is nested, and change the code which support this 2011-03-05 20:10:24 +00:00
tags.yml
tasks.yml restores the API docs of AR::Fixtures, made a quick pass over them, revises link in fixture template [closes #2840] 2011-09-03 15:20:30 -07:00
teapots.yml Fixtures support for ActiveRecord::Model 2011-12-24 11:08:15 +00:00
topics.yml
toys.yml
traffic_lights.yml Make serialized fixtures work again 2010-12-29 16:15:45 +00:00
treasures.yml
variants.yml
vertices.yml
warehouse-things.yml
zines.yml