aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #16220 from pcreux/postgresql-jsonb-supportYves Senn2014-07-256-9/+64
|\ | | | | | | Add support for Postgresql JSONB
| * Add support for Postgresql JSONBPhilippe Creux2014-07-246-9/+64
|/ | | | [Philippe Creux, Chris Teague]
* tests, run adapter specific rake tests only for the right adapter.Yves Senn2014-07-243-0/+6
|
* build fix, fix error introduced with 091b246bb0111357edbb9703ea342a944b04deb6Yves Senn2014-07-241-2/+2
| | | | | | | | | | | | | | Fixes the following issue: 1) Failure: ActiveRecord::MySQLPurgeTest#test_establishes_connection_to_test_database [test/cases/tasks/mysql_rake_test.rb:200]: not all expectations were satisfied unsatisfied expectations: - expected exactly once, not yet invoked: ActiveRecord::Base.establish_connection(:test) satisfied expectations: - allowed any number of times, invoked once: #<Mock:0x2349430>.recreate_database(any_parameters) - allowed any number of times, invoked once: ActiveRecord::Base.establish_connection(any_parameters) - allowed any number of times, invoked once: ActiveRecord::Base.connection(any_parameters)
* fix, mysql `db:purge` respects `Rails.env`.Yves Senn2014-07-242-1/+5
| | | | | | | | | | | | | | | | | | | | Previously this method always established a connection to the test database. This resulted in buggy behavior when combined with other tasks like `bin/rake db:schema:load`. This was one of the reasons why #15394 (22e9a91189af2c4e6217a888e77f22a23d3247d1) was reverted: > I’ve replicated it on a new app by the following commands: 1) rails generate model post:title, 2) rake db:migrate, 3) rake db:schema:load, 4) rails runner ‘puts Post.first’. The last command goes boom. Problem is that rake db:schema:load wipes the database, and then doesn’t actually restore it. This is all on MySQL. There’s no problem with SQLite. -- DHH https://github.com/rails/rails/commit/22e9a91189af2c4e6217a888e77f22a23d3247d1#commitcomment-6834245
* clenaup, unify CHANGELOG format. [ci skip]Yves Senn2014-07-241-5/+7
|
* Merge pull request #16280 from a3gis/masterMatthew Draper2014-07-241-2/+2
|\ | | | | Fixes #16265 and correct documentation typo
| * Fix documentation typo in ConnectionSpecification::Resolve.speca3gis2014-07-241-1/+1
| |
| * Fixes #16265a3gis2014-07-241-1/+1
| |
* | pg, `change_column_default, :table, :column, nil` issues `DROP DEFAULT`.Yves Senn2014-07-242-1/+16
|/ | | | | | | | | | | | Closes #16261. [Matthew Draper, Yves Senn] Using `DEFAULT NULL` results in the same behavior as `DROP DEFAULT`. However, PostgreSQL will cast the default to the columns type, which leaves us with a default like "default NULL::character varying". /cc @matthewd
* Merge pull request #16231 from Envek/type_in_referencesYves Senn2014-07-226-5/+56
|\ | | | | | | | | | | * Allow to specify a type for foreign key column in migrations * unified the docs * some cleanup in CHANGELOG
| * Allow to specify a type for foreign key column in migrationsAndrey Novikov2014-07-226-3/+46
|/ | | | [Andrey Novikov & Łukasz Sarnacki]
* Merge pull request #16253 from ↵Yves Senn2014-07-221-1/+1
|\ | | | | | | | | zuhao/refactor_activerecord_nested_through_associations_test Make sure assertion passes for postgresql.
| * Make sure assertion passes for postgresql.Zuhao Wan2014-07-221-1/+1
| |
* | Remove redundant that already happened in teardown.Zuhao Wan2014-07-221-1/+0
|/
* build fix, remove not null constraint.Yves Senn2014-07-221-1/+1
| | | | | | | | | | | The fixtures are still in play, adding a new column without a default and `null: true` is not possible. This reverts back to leaking global state, as our `schema.rb` adds the `null: false` constraint on this field. A future solution would be to make the `migration_test.rb` run independent of fixture tables. This way we can simply drop the state after test execution, without worrying about side effects. /cc @zuhao
* Merge pull request #16250 from zuhao/refactor_activerecord_migration_testYves Senn2014-07-221-1/+1
|\ | | | | Remove length limit that results failure in other tests.
| * Remove length limit that results failure in other tests.Zuhao Wan2014-07-221-1/+1
| |
* | Remove the side-effects of validates_presence_of.Zuhao Wan2014-07-221-2/+3
|/
* Touch option description grammatical error fixed [ci skip]vadivelan2014-07-211-1/+1
|
* Merge branch 'rm-remove-mocha'Rafael Mendonça França2014-07-191-0/+2
|\ | | | | | | | | Conflicts: actionpack/test/abstract_unit.rb
| * Stop requiring mocha automaticallyRafael Mendonça França2014-07-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | We are planning to remove mocha from our test suite because of performance problems. To make this possible we should stop require mocha on ActionSupport::TestCase. This should not affect applications since users still need to add mocha to Gemfile and this already load mocha. Added FIXME notes to place that still need mocha removal
* | Merge pull request #16227 from Aguynamedsteve/typo_correctionYves Senn2014-07-191-1/+1
|\ \ | | | | | | Fixed typo in comment [ci skip]
| * | Fixed typo in commentSteve2014-07-191-1/+1
| | |
* | | create_join_table uses same logic as HABTM reflectionsStefan Kanev2014-07-185-2/+44
| | | | | | | | | | | | | | | | | | | | | | | | Before this change, create_join_table would not remove the common prefix in the join table name, unlike ActiveRecord::Reflections. A HABTM between Music::Artist and Music::Record would use a table music_artists_records, while create_join table would create music_artists_music_records.
* | | Merge pull request #15762 from arthurnn/better_error_on_bad_alias_methodMatthew Draper2014-07-183-10/+27
|\ \ \ | | | | | | | | | | | | Dont swallow errors when bad alias_method
| * | | Dont swallow errors when bad alias_methodArthur Neves2014-06-243-10/+27
| | | |
* | | | Disable some tests on SQLiteRafael Mendonça França2014-07-171-77/+77
| | | | | | | | | | | | | | | | | | | | These tests were passing before because the precision were not using to cast the value. Not it is being used so it would fail on sqlite3
* | | | Prefer if/else for this caseRafael Mendonça França2014-07-171-3/+2
| | | | | | | | | | | | | | | | | | | | One of the branches is using a proc to check if the value respond_to a method so it is better to not do case comparations
* | | | Merge pull request #16188 from marianovalles/fix_rational_to_decimal_type_castRafael Mendonça França2014-07-173-9/+38
|\ \ \ \ | | | | | | | | | | | | | | | Fix rational to decimal on type_cast_from_user
| * | | | Fix decimal_test module and add new test for object responding to to_dMariano Valles2014-07-162-7/+15
| | | | |
| * | | | Fix case statement to use ::Numeric and ::StringMariano Valles2014-07-163-18/+25
| | | | |
| * | | | Change class evaluation for Rationals in cast_valueMariano Valles2014-07-162-5/+7
| | | | |
| * | | | Fix rational to decimal on type_cast_from_userMariano Valles2014-07-162-1/+13
| | | | |
* | | | | Remove need for macro instance vareileencodes2014-07-171-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Same as we did for collection, removed the `@macro` instance var and it is now set in each association. Unfortunately it can't be left undefined in AssociationReflection so it has to be set there. For now I am setting it to NotImplementedError since there is no default macro and it changes based on the reflection type.
* | | | | Remove unused 1:1 association :remote optionChris Griego2014-07-161-1/+1
| | | | | | | | | | | | | | | This option is unused, left over from pre-1.0 Rails to internally distinguish the location of the foreign key.
* | | | | Merge pull request #16196 from yahonda/mysql_restrict_testMatthew Draper2014-07-172-8/+6
|\ \ \ \ \ | | | | | | | | | | | | Revert "Rename to test_mysql_strict_mode_disabled_dont_override_global_sql_mode"
| * | | | | Revert "Rename to test_mysql_strict_mode_disabled_dont_override_global_sql_mode"Yasuo Honda2014-07-172-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit babc24c1b07c1fd58b9b3249b0256f9b0d45c0f0. Conflicts: activerecord/test/cases/adapters/mysql/connection_test.rb activerecord/test/cases/adapters/mysql2/connection_test.rb
* | | | | | Merge pull request #15944 from seuros/uuidRafael Mendonça França2014-07-163-1/+51
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Treat invalid uuid as nil Conflicts: activerecord/CHANGELOG.md
| * | | | | | Treat invalid uuid as nilAbdelkader Boudih2014-07-143-1/+51
| | | | | | |
* | | | | | | Merge pull request #16183 from goddamnhippie/fix-psych-warningRafael Mendonça França2014-07-162-0/+6
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Implement required #encode_with
| * | | | | | | Move #encode_with to RelationGustavo Beathyate2014-07-152-4/+5
| | | | | | | |
| * | | | | | | Implement required #encode_withGustavo Beathyate2014-07-152-0/+5
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While running the spec `ARCONN=mysql2 ruby -v -Itest test/cases/yaml_serialization_test.rb` the following warning shows up: `implementing to_yaml is deprecated, please implement "encode_with"`
* | | | | | | Merge pull request #15718 from chancancode/regression_from_15694Godfrey Chan2014-07-162-1/+10
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fixed a regression introduced in 84cf156
| * | | | | | | Fixed a regression introduced in 84cf156Godfrey Chan2014-06-142-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 84cf156 (PR #15694) introduced a subtle regression. There are actually three distinct entry points to creating an AR object – via .new (i.e. #initialize), via #init_with (e.g. from YAML or database queries) and via .allocate. With the patch in 84cf156, attribute methods and respond_to? will not work correctly when objects are allocated directly, without going through either The reason this test case didn't catch the regression was that the `Topic` class is shared between test cases, so by the time this test case is ran the attribute methods are very likely to be defined. Switching to use a fresh anonymous class in the test to ensure we surface this problem in the future.
* | | | | | | | nodoc enum hooks [ci skip]Rafael Mendonça França2014-07-161-2/+2
| | | | | | | |
* | | | | | | | we intend to keep the `capture` helper for Active Record tests.Yves Senn2014-07-161-18/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow up to f8f5cdc
* | | | | | | | Active Record tests still depend on `capture`. Let's keep it for now.Yves Senn2014-07-162-19/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to 3121412 /cc @rafaelfranca This will remove deprecation warnings from the PostgreSQL suite: ``` DEPRECATION WARNING: #capture(stream) is deprecated and will be removed in the next release. (called from capture at /Users/senny/Projects/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:89) /Users/senny/Projects/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:89:in `capture' /Users/senny/Projects/rails/activerecord/test/cases/adapters/postgresql/composite_test.rb:73:in `ensure_warning_is_issued' /Users/senny/Projects/rails/activerecord/test/cases/adapters/postgresql/composite_test.rb:48:in `test_column' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:106:in `block (3 levels) in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:204:in `capture_exceptions' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:103:in `block (2 levels) in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:256:in `time_it' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:102:in `block in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:317:in `on_signal' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:276:in `with_info_handler' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:101:in `run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:759:in `run_one_method' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:293:in `run_one_method' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:287:in `block (2 levels) in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:286:in `each' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:286:in `block in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:317:in `on_signal' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:306:in `with_info_handler' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:285:in `run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `block in __run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `map' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `__run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:126:in `run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:55:in `block in autorun' ```
* | | | | | | | use foreign key DSL in our tests.Yves Senn2014-07-162-5/+4
| | | | | | | |
* | | | | | | | Merge pull request #16138 from sgrif/sg-attribute-set-keyYves Senn2014-07-163-10/+10
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | AttributeSet#include? -> AttributeSet#key?