aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema/schema.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve the derivation of HABTM assocation join table namesAndrew White2012-06-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #6238 from pwnall/pgsql_bytea_limitAaron Patterson2012-05-171-0/+1
|\ | | | | Postgresql doesn't accept limits on binary (bytea) columns.
| * Postgresql doesn't accept limits on binary (bytea) columns.Victor Costan2012-05-091-0/+1
| |
* | SQLite3 doesn't actually support the 'time' type.Erich Menge2012-05-151-0/+1
| |
* | MySQL doesn't allow default values for blobs.Rafael Mendonça França2012-05-131-2/+2
| |
* | Custom coders support for ActiveRecord::Store. JSON, YAML, Marshal can be ↵Andrey Voronkov2012-05-091-0/+2
|/ | | | used out of the box.
* Modify test schema.rb to use a VARCHAR rather than a TEXT when a default is ↵Michael Pearson2012-05-051-1/+3
| | | | required to keep MySQL happy.
* Duplicate column_defaults properly (closes #6115)Piotr Sarnacki2012-05-041-0/+1
|
* whitespace :scissors:Jon Leighton2012-03-301-1/+1
|
* Merge pull request #5334 from courtland/masterJon Leighton2012-03-301-0/+5
|\ | | | | Fix deleting from a HABTM join table upon destroying an object of a model with optimistic locking enabled.
| * Tests for removing a HABTM association when optimistic locking is enabled.Nick Rogers2012-03-071-0/+5
| |
* | Nested attribute setters can be overridden.Jonathan Mukai & Peter Jaros2012-03-281-0/+1
| | | | | | | | Overriding implementation can call super.
* | attributes are cached by string keys, so to_s to support symbols. fixes #5549Aaron Patterson2012-03-271-0/+1
|/
* added test for #3732Rick Martinez2012-02-101-0/+5
|
* Made schema dumper recognize partial indices' where statementsMarcelo Silveira2012-02-091-0/+1
|
* Allow store to be a not null column.Jeremy Walker2012-02-021-1/+2
|
* Merge pull request #4696 from rafaelfranca/issue-4653Aaron Patterson2012-01-261-2/+0
| | | | Remove extra attributes from HABTM join tables in AR tests
* Fix bug where reset_counters resets the wrong counter cache.David Peter2012-01-161-0/+10
| | | | | | | | If a model belongs_to two associations with the same class, then reset_counters will reset the wrong counter cache. Finding the right reflection should use the foreign_key instead, which should be unique.
* Merge branch 'master' of git://github.com/rails/railsDmitry Polushkin2011-12-311-0/+14
|\
| * Test fixtures with custom model and table namesAlexey Muranov2011-12-301-0/+5
| | | | | | | | | | | | 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.
| * Support establishing connection on ActiveRecord::Model.Jon Leighton2011-12-281-0/+1
| | | | | | | | | | This is the 'top level' connection, inherited by any models that include ActiveRecord::Model or inherit from ActiveRecord::Base.
| * Fixtures support for ActiveRecord::ModelJon Leighton2011-12-241-0/+1
| |
| * I herd you like modules.Jon Leighton2011-12-241-0/+4
| |
| * serialize fails on subclassAlvaro Bautista2011-12-231-0/+2
| |
| * Added ActiveRecord::Base.store for declaring simple single-column key/value ↵David Heinemeier Hansson2011-10-131-0/+1
| | | | | | | | stores [DHH]
* | Merge branch 'master' of git://github.com/rails/railsDmitry Polushkin2011-09-151-1/+7
|\|
| * Raise error when using write_attribute with a non-existent attribute.Jon Leighton2011-09-131-1/+7
| | | | | | | | | | | | | | | | | | Previously we would just silently write the attribute. This can lead to subtle bugs (for example, see the change in AutosaveAssociation where a through association would wrongly gain an attribute. Also, ensuring that we never gain any new attributes after initialization will allow me to reduce our dependence on method_missing.
* | Test polymorphic record with optimistic locking and counter cache should be ↵Dmitry Polushkin2011-09-091-0/+1
|/ | | | destoyed without catching the ActiveRecord::StaleObjectError.
* Fix exception if old and new targets are both nil. Fixes #1471.Jon Leighton2011-07-121-0/+1
|
* Merge pull request #2017 from Casecommons/active_record_lintJosé Valim2011-07-081-0/+2
|\ | | | | ActiveRecord::Base subclasses should pass ActiveModel::Lint.
| * ActiveRecord::Base should pass ActiveModel::Lint.Grant Hutchins & Peter Jaros2011-07-081-0/+2
| |
* | Destroy association habtm record before destroying the record itself. Fixes ↵Tomas D'Stefano2011-07-081-0/+2
|/ | | | issue #402.
* Merge pull request #560 from guilleiguaran/fix_pluralize_table_names_falseJon Leighton2011-05-161-0/+4
|\ | | | | Fixing has_many when ActiveRecord::Base.pluralize_table_names is false
| * Fixing has_many association when ActiveRecord::Base.pluralize_table_names is ↵Guillermo Iguaran2011-05-151-0/+4
| | | | | | | | false. fixes #557
* | CollectionAssociation#merge_target_lists should write to the underlying ↵Jon Leighton2011-05-141-0/+1
|/ | | | attributes when copying, rather than using the assignment method
* Add test to specify that attributes from an association's conditions should ↵Jon Leighton2011-05-101-0/+1
| | | | be assigned without mass-assignment protection when a record is built on the association.
* Don't quote ID's as Arel will quote them -- follow same conventions as the ↵Christopher Meiklejohn2011-05-081-0/+6
| | | | delete method.
* singular and collection relations in AR can now specify mass-assignment ↵Josh Kalderimis2011-05-011-0/+2
| | | | security options (:as and :without_protection) in build, create and create! methods.
* using the database adapter to typecast before executing prepared statementAaron Patterson2011-04-141-0/+1
|
* Allow to read and write AR attributes with non valid identifiersSantiago Pastorino2011-03-221-0/+3
|
* Merge branch 'master' into nested_has_many_throughJon Leighton2011-03-041-0/+28
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/class_methods/join_dependency.rb activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb activerecord/lib/active_record/associations/has_many_association.rb activerecord/lib/active_record/associations/has_many_through_association.rb activerecord/lib/active_record/associations/has_one_association.rb activerecord/lib/active_record/associations/has_one_through_association.rb activerecord/lib/active_record/associations/through_association_scope.rb activerecord/lib/active_record/reflection.rb activerecord/test/cases/associations/has_many_through_associations_test.rb activerecord/test/cases/associations/has_one_through_associations_test.rb activerecord/test/cases/reflection_test.rb activerecord/test/cases/relations_test.rb activerecord/test/fixtures/memberships.yml activerecord/test/models/categorization.rb activerecord/test/models/category.rb activerecord/test/models/member.rb activerecord/test/models/reference.rb activerecord/test/models/tagging.rb
| * The optimistic lock column should be increased when calling touchFranck Verrot2011-02-091-0/+1
| | | | | | | | Signed-off-by: Santiago Pastorino and José Ignacio Costa <santiago+jose@wyeworks.com>
| * make set_table_name take effect immediatelyJan2011-02-081-0/+4
| |
| * Correctly update counter caches on deletion for has_many :through [#2824 ↵Jon Leighton2011-02-071-0/+4
| | | | | | | | state:resolved]. Also fixed a bunch of other counter cache bugs in the process, as once I fixed this one others started appearing like nobody's business.
| * Support the :dependent option on has_many :through associations. For ↵Jon Leighton2011-02-071-0/+1
| | | | | | | | historical and practical reasons, :delete_all is the default deletion strategy employed by association.delete(*records), despite the fact that the default strategy is :nullify for regular has_many. Also, this only works at all if the source reflection is a belongs_to. For other situations, you should directly modify the through association.
| * Fixing ordering of HABTM association deletion [#6191 state:resolved]Edward Faulkner2011-02-041-0/+13
| | | | | | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
| * Add create_association! for belongs_toJon Leighton2011-01-161-0/+1
| |
| * Support for :counter_cache on polymorphic belongs_toJon Leighton2010-12-311-0/+1
| |
| * Fix creation of has_many through records with custom primary_key option on ↵Szymon Nowak2010-12-231-0/+1
| | | | | | | | belongs_to [#2990 state:resolved]
| * has_many associations with :dependent => :delete_all should update the ↵Jon Leighton2010-12-201-0/+1
| | | | | | | | counter cache when deleting records