aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
Commit message (Collapse)AuthorAgeFilesLines
* Accept belongs_to assoc. keys in ActiveRecord queriesbeerlington2012-09-111-0/+1
| | | | | | | | | | | | | Allows you to specify the model association key in a belongs_to relationship instead of the foreign key. The following queries are now equivalent: Post.where(:author_id => Author.first) Post.where(:author => Author.first) PriceEstimate.where(:estimate_of_type => 'Treasure', :estimate_of_id => treasure) PriceEstimate.where(:estimate_of => treasure)
* postgres, map scaled intervals to string datatype (#7518)Yves Senn2012-09-061-1/+2
|
* ActiveRecord support to PostgreSQL 9.2 JSON typeDickson S. Guedes2012-09-051-1/+10
| | | | | | | | | This implements the support to encode/decode JSON data to/from database and creating columns of type JSON using a native type [1] supported by PostgreSQL from version 9.2. [1] http://www.postgresql.org/docs/9.2/static/datatype-json.html
* Fix pluck when columns/tables are reserved words.Ian Lesperance2012-09-051-0/+4
|
* test cleanup, remove ruby_type because it's no longer neededYves Senn2012-09-031-2/+1
| | | | | All tests with a custom inheritance_column use the `Vegtable` model. The field ruby_type on the Company models is no longer needed
* rewrite inheritance tests with a custom inheritance_columnYves Senn2012-09-031-0/+1
| | | | | | previously the tests with and without a custom `inheritance_column` used the same models. Since the model then has both fields this can lead to false positives.
* set the configured #inheritance_column on #become (#7503)Yves Senn2012-09-031-0/+5
| | | | | | | | | | | | | | | I had to create a new table because I needed an STI table, which does not have both a "type" and a "custom_type" the test fails with: 1) Error: test_alt_becomes_works_with_sti(InheritanceTest): NoMethodError: undefined method `type=' for #<Cabbage id: 1, name: "my cucumber", custom_type: "Cucumber"> /Users/username/Projects/rails/activemodel/lib/active_model/attribute_methods.rb:432:in `method_missing' /Users/username/Projects/rails/activerecord/lib/active_record/attribute_methods.rb:100:in `method_missing' /Users/username/Projects/rails/activerecord/lib/active_record/persistence.rb:165:in `becomes' test/cases/inheritance_test.rb:134:in `test_becomes_works_with_sti' test/cases/inheritance_test.rb:140:in `test_alt_becomes_works_with_sti'
* reset_counters() was crashing when there were multiple belongs_to ↵Dave Desrochers2012-08-211-0/+6
| | | | | | associations with the same foreign key. This closes #5200.
* Modity the :json_data_empty attribute from `:null => false` to `:null => true`Yasuo Honda2012-07-281-1/+1
| | | | | | | to address ORA-01400 errors with Oracle enhanced adapter. The original commit 3c0bf043 requires :json_data_empty attribute has empty string OR null, then setting `:default => ""` is enough.
* Modify the preference attribute from `:null => false` to `:null => true`Yasuo Honda2012-07-271-1/+1
| | | | | | | | to address ORA-01400 errors with Oracle enhanced adapter. Issue #4856 had been fixed and tested with the attribute `:null => false, :default => ""`. Now `:null => false` attribute is not necessary to test this issue.
* Use string datatype for the setting attributeYasuo Honda2012-07-261-1/+1
| | | | to make store works all database adapters.
* This pull requests addresses ORA-01400 errors and also supports #6115 issue ↵Yasuo Honda2012-07-251-1/+1
| | | | | | | | | tested. Issue #6115 has been fixed and tested with the attribute `:null => false, :default => ""` However `:null => false` attribute is not necessary to test this issue, which causes many ORA-01400 errors with Oracle enhanced adapter.
* fix: limit of enum columns of mysqlYamada Masaki2012-06-282-0/+19
|
* Revert "Merge pull request #6344"Piotr Sarnacki2012-06-251-1/+0
| | | | | | | | | | | | | | This commit needs to be reverted because it introduces difficulties when using sqlite3 in development and other databases in production. This happens because when you create time column in sqlite3, it's dumped as datetime in schema.rb file. This reverts commit 57d534ee9e441d078fcc161c0c78ebaa5aacd736, reversing changes made to 20f049fb50daee0c5e5a69b55b529af5737e8e3f. Conflicts: activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
* 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.
* Add uuid type support to PostgreSQL adapterKonstantin Shabanov2012-06-141-1/+9
|
* 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
| |
* | Merge pull request #5807 from Antiarchitect/store-improvementRafael Mendonça França2012-05-131-0/+2
|\ \ | | | | | | Custom coders support for ActiveRecord::Store.
| * | Custom coders support for ActiveRecord::Store. JSON, YAML, Marshal can be ↵Andrey Voronkov2012-05-091-0/+2
| |/ | | | | | | used out of the box.
* / mispelling errors in render_text_test.rb and sqlite_specific_schemaangelo giovanni capilleri2012-05-121-1/+1
|/
* 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
|
* Create plpgsql language if not availablePrem Sichanugrist2012-04-271-21/+29
| | | | | This should fix the problem in Travis CI server. (http://travis-ci.org/#!/rails/rails/jobs/1194988)
* add use_returning as a postgresql connection configDoug Cole2012-03-311-2/+27
|
* 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
|/
* Fix type_to_sql with text and limit on mysql/mysql2. Fix GH #3931.kennyj2012-02-262-3/+3
|
* Merge pull request #5000 from flavorpill/master-with-multidb-association-fixAaron Patterson2012-02-131-0/+5
|\ | | | | Fix associations with per-class/multiple database connections
| * added test for #3732Rick Martinez2012-02-101-0/+5
| |
* | Merge branch 'joelhoffman-postgres_schema_builder' into instance_readerAaron Patterson2012-02-101-1/+10
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | * joelhoffman-postgres_schema_builder: Also support writing the hstore back to the database Hstore values are all strings string_to_hstore / hstore_to_string, serializing don't test schema where hstore not installed schema dumper tests for hstore Additional hstore tests, supporting null values, better compliance with postgres docs add hstore to postgres native types and defaults Conflicts: activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
| * don't test schema where hstore not installedJoel2012-02-081-0/+2
| |
| * schema dumper tests for hstoreJoel2012-02-081-1/+8
| |
* | 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-313-1/+37
|\
| * 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]
| * Only use LOWER for mysql case insensitive uniqueness check when column has a ↵Joseph Palermo2011-10-092-1/+23
| | | | | | | | case sensitive collation.