aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | 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?
| * | | | | | | | | AttributeSet#include? -> AttributeSet#key?Sean Griffin2014-07-113-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/rails/rails/pull/15868/files#r14135210
* | | | | | | | | | Move uuid_v5 and uuid_v3 to Digest::UUIDRafael Mendonça França2014-07-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These methods are not random so they should not belings to SecureRandom module.
* | | | | | | | | | Merge pull request #16180 from rafaelfranca/rm-dirtyRafael Mendonça França2014-07-152-4/+16
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Improve Active Model Dirty API.
| * | | | | | | | | | Deprecate `reset_#{attribute}` in favor of `restore_#{attribute}`.Rafael Mendonça França2014-07-151-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These methods may cause confusion with the `reset_changes` that behaves differently of them. Also rename undo_changes to restore_changes to match this new set of methods.
| * | | | | | | | | | Deprecate ActiveModel::Dirty#reset_changes in favor of ↵Rafael Mendonça França2014-07-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #clear_changes_information This method name is causing confusion with the `reset_#{attribute}` methods. While `reset_name` set the value of the name attribute for the previous value the `reset_changes` only discard the changes and previous changes.
* | | | | | | | | | | Keep quietly and capture undeprecated on your suiteRafael Mendonça França2014-07-152-0/+29
| | | | | | | | | | |
* | | | | | | | | | | Merge branch 'master' of git://github.com/rails/railsGodfrey Chan2014-07-154-6/+24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG.md
| * | | | | | | | | | Merge branch 'jbrowning-fix_mariadb_rename_index'Rafael Mendonça França2014-07-154-6/+24
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #15936
| | * | | | | | | | | | Predicate methods don't need to return `true` / `false`Rafael Mendonça França2014-07-151-1/+1
| | | | | | | | | | | |
| | * | | | | | | | | | Fix version detection for RENAME INDEX support. Fixes #15931.Jeff Browning2014-07-154-6/+24
| | | | | | | | | | | |
* | | | | | | | | | | | Document the change in `nil` handling for serialized attributesGodfrey Chan2014-07-151-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also updated the test case to reflect that
* | | | | | | | | | | | Fixed SQL syntax for postgresqlGodfrey Chan2014-07-151-1/+1
| | | | | | | | | | | |
* | | | | | | | | | | | Merge pull request #16162 from chancancode/fix_json_coderGodfrey Chan2014-07-152-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed JSON coder when loading NULL from DB
* | | | | | | | | | | | Revert "Revert "Merge pull request #16059 from jenncoop/json-serialized-attr""Godfrey Chan2014-07-155-2/+76
|/ / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6f3c64eeb1dc8288dae49f114aaf619adc7dcb7f. Conflicts: activerecord/CHANGELOG.md
* / / / / / / / / / / Add CHANGELOG entry for #15266Godfrey Chan2014-07-151-0/+5
|/ / / / / / / / / /
* | | | | | | | | | Merge pull request #15266 from dv/use_counter_cache_for_empty_callGodfrey Chan2014-07-152-0/+15
|\ \ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / / |/| | | | | | | | | If a counter_cache exists, use it for #empty?
| * | | | | | | | | If a counter_cache exists, use it for #empty?David Verhasselt2014-06-102-0/+15
| | | | | | | | | |
* | | | | | | | | | [CI SKIP] Doc fix.Guo Xiang Tan2014-07-151-2/+2
| | | | | | | | | |
* | | | | | | | | | Merge pull request #16089 from ↵Aaron Patterson2014-07-143-101/+158
|\ \ \ \ \ \ \ \ \ \ | |_|_|_|_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | eileencodes/refactor-reflections-from-sub-classes-to-delegates Refactor reflections from sub classes to delegates
| * | | | | | | | | Begin refactoring ThroughReflectioneileencodes2014-07-083-101/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to decouple AssociationReflection and ThroughReflection making ThroughReflection it's own Reflection bucket in a way. The benefit of this is to be able to remove checks against the macro's symbol for exmaple `macro == :belongs_to`. Get all tests passing again Some of the methods that used to be inherited from MacroReflection through AssociationReflection were no longer getting passed through. They needed to be duplicated into the ThroughReflection. I will extract these out into a separate class. Refactor shared methods into strategy object Now that we've separated ThroughReflection and AssociationReflection we can combine shared methods into one class to avoid duplication. Break out class for each type of reflection This creates a class for each reflection type (has_many, has_one, belongs_to and habtm). We then can remove the need to set the macro symbol in each initialization. Tests were updated to reflect these changes because creation of these reflections is now different. Remove need for @collection instance var We now define `collection?` as `false` by default and set it to `true` in `has_and_belongs_to_many` and `has_many` reflections. This removes the need for the `@collection` instance variable. Raise exception on unknown macro types We shouldn't accept just any macro when creating reflections. An unrecongnized AssociationReflection raises an error. Tests in `reflection_test` were updated to reflect these new changes. `:has_and_belongs_to_many` macro tests were removed because we no longer internally return HABTM.
* | | | | | | | | | Address ORA-00972: identifier is too long when tested with OracleYasuo Honda2014-07-143-4/+5
| |_|_|_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | by using shorter attribute names.
* | | | | | | | | Merge pull request #16127 from Envek/fix_16111Matthew Draper2014-07-143-1/+32
|\ \ \ \ \ \ \ \ \ | |_|_|_|_|_|/ / / |/| | | | | | | | Dump PostgreSQL primary key with custom function as a default.
| * | | | | | | | Dump PostgreSQL primary key with custom function as a default.Andrey Novikov2014-07-113-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example, if use pgcrypto extension in PostgreSQL 9.4 beta 1, where uuid-ossp extension isn't available for moment of writing, and thus to use a gen_random_uuid() method as a primary key default. In this case schema dumper wasn't able to correctly reconstruct create_table statement and lost primary key constraint on schema load. Fixes #16111.
* | | | | | | | | Fixing typo in commentGregory Igelmund2014-07-121-1/+1
| | | | | | | | |
* | | | | | | | | Merge pull request #16136 from sgrif/sg-pg-bit-stringMatthew Draper2014-07-122-13/+33
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Don't rely on the column SQL type for bit string quoting
| * | | | | | | | | Don't rely on the column SQL type for bit string quotingSean Griffin2014-07-112-13/+33
| | |_|_|/ / / / / | |/| | | | | | |
* | | | | | | | | Merge pull request #16055 from sgrif/sg-refactor-sqlite3-stringsMatthew Draper2014-07-122-14/+29
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | Use a type object for type casting behavior on SQLite3
| * | | | | | | | Use a type object for type casting behavior on SQLite3Sean Griffin2014-07-112-14/+29
| | | | | | | | |
* | | | | | | | | Synced 4.2 release notes with the latest commits.Godfrey Chan2014-07-111-1/+1
| |/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also reordered some of the items to put newer ones on top (same order as CHANGELOGs), which makes it easier to diff while we are still working on it.