aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
Commit message (Collapse)AuthorAgeFilesLines
* Whitespace :heart: and hash syntax changeRafael Mendonça França2013-02-201-23/+22
|
* descriptive error message when AR adapter was not found. Closes #7313.Yves Senn2013-02-201-0/+9
|
* delete duplicated tests in AR base_test.rbTakehiro Adachi2013-02-191-23/+0
| | | | These are duplicated with the tests which are in relations_test.rb
* add tests for ActiveRecord::Base#createTakehiro Adachi2013-02-181-0/+8
|
* Revert "checking in the abstractions for valid type checking:"Jon Leighton2013-02-153-27/+0
| | | | | | | | | | | | | | | | This reverts commit c321b309a9a90bbfa0912832c11b3fef52e71840. Conflicts: activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb Reason: failing test 1) Error: test_valid_column(ActiveRecord::ConnectionAdapters::SQLite3AdapterTest): NoMethodError: undefined method `column' for test/cases/adapters/sqlite3/sqlite3_adapter_test.rb:29:in `test_valid_column'
* don't cache invalid subsets when preloading hmt associations.Yves Senn2013-02-141-0/+6
| | | | closes #8423.
* Don't call after_commit when creating through an association and save fails, ↵James Miller2013-02-131-0/+27
| | | | fixes #5802
* Merge pull request #9204 from ranjaykrishna/col-probAaron Patterson2013-02-123-0/+27
|\ | | | | schema dumper tests now conducted by ActiveRecord::Base.Connection
| * checking in the abstractions for valid type checking:Ranjay Krishna2013-02-123-0/+27
| |
* | test for regression from a712e08ebe21f6d8653a0e6602df2e0f5d40d9caAaron Patterson2013-02-111-0/+6
| |
* | define Active Record Store accessors in a moduleSergey Nartimov2013-02-112-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Allow store accessors to be overrided like other attribute methods, e.g.: class User < ActiveRecord::Base store :settings, accessors: [ :color, :homepage ], coder: JSON def color super || 'red' end end
* | fixing bit string testAaron Patterson2013-02-101-3/+3
| |
* | Reverting e170014113 (Change behaviour with empty hash in where clause)Guillermo Iguaran2013-02-081-6/+2
| |
* | Reverting 16f6f25 (Change behaviour with empty array in where clause)Guillermo Iguaran2013-02-083-6/+12
| |
* | Change behaviour with empty array in where clauserobertomiranda2013-02-083-12/+6
| |
* | Change behaviour with empty hash in where clauserobertomiranda2013-02-081-2/+6
| |
* | Merge pull request #9207 from dylanahsmith/mysql-quote-numericGuillermo Iguaran2013-02-074-10/+37
|\ \ | | | | | | active_record: Quote numeric values compared to string columns.
| * | active_record: Quote numeric values compared to string columns.Dylan Smith2013-02-074-10/+37
| | |
* | | Skip schema dumper extensions test if connection does not support itCarlos Antonio da Silva2013-02-071-0/+1
|/ / | | | | | | | | Travis failed because the postgresql version installed there does not support extensions, so we just need to skip this for now.
* | Run schema dumper extensions without creating real extensionsCarlos Antonio da Silva2013-02-061-9/+2
| | | | | | | | | | There is no need to create the extension in the database just to test if it's dumped, we can stub that instead.
* | Do not print anything related to extensions when they don't none existCarlos Antonio da Silva2013-02-061-0/+10
| | | | | | | | | | When extensions are supported but there's no one enabled in the database, we should not print anything related to them in schema.rb.
* | improve tests to check for existence of extensions method, and skip testing ↵Justin George2013-02-062-8/+8
| | | | | | | | dumped extensions if they are unsupported by the database
* | Add some tests to enumerate how extensions should be stored in the schema outputJustin George2013-02-062-0/+15
| |
* | Enable hstore extensions on tests if it is not enabled and database supports itRafael Mendonça França2013-02-051-1/+8
| |
* | DATABASE_URL parsing should turn numeric strings into numeric types, andAaron Stone2013-01-311-11/+37
| | | | | | | | | | | | the strings true and false into boolean types, in order to match how YAML would parse the same values from database.yml and prevent unexpected type errors in the database adapters.
* | Merge pull request #9119 from dazuma/database_tasks_for_unknown_adapterCarlos Antonio da Silva2013-01-311-0/+6
|\ \ | | | | | | Raise an exception with a useful message if a rake task is requested for an unknown adapter
| * | Raise a specific exception with a useful message if a rake task is requested ↵Daniel Azuma2013-01-301-0/+6
| | | | | | | | | | | | for an unknown adapter
* | | class_eval should use __FILE__ and __LINE__Neeraj Singh2013-01-301-1/+1
|/ /
* | add API to pg for enabling / disabling hstoreAaron Patterson2013-01-281-7/+29
| |
* | Use Encoding::UTF_8 constant :do_not_litter:Akira Matsuda2013-01-282-2/+2
| |
* | Prevent Relation#merge from collapsing wheres on the RHSJon Leighton2013-01-276-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This caused a bug with the new associations implementation, because now association conditions are represented as Arel nodes internally right up to when the whole thing gets turned to SQL. In Rails 3.2, association conditions get turned to raw SQL early on, which prevents Relation#merge from interfering. The current implementation was buggy when a default_scope existed on the target model, since we would basically end up doing: default_scope.merge(association_scope) If default_scope contained a where(foo: 'a') and association_scope contained a where(foo: 'b').where(foo: 'c') then the merger would see that the same column is representated on both sides of the merge and collapse the wheres to all but the last: where(foo: 'c') Now, the RHS of the merge is left alone. Fixes #8990
* | Fix cases where delete_records on a has_many association caused errorsDerek Kraan2013-01-273-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | because of an ambiguous column name. This happened if the association model had a default scope that referenced a third table, and the third table also referenced the original table (with an identical foreign_key). Mysql requires that ambiguous columns are deambiguated by using the full table.column syntax. Postgresql and Sqlite use a different syntax for updates altogether (and don't tolerate table.name syntax), so the fix requires always including the full table.column and discarding it later for Sqlite and Postgresql.
* | Fix handling of dirty time zone aware attributesLilibeth De La Cruz2013-01-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when `time_zone_aware_attributes` were enabled, after changing a datetime or timestamp attribute and then changing it back to the original value, `changed_attributes` still tracked the attribute as changed. This caused `[attribute]_changed?` and `changed?` methods to return true incorrectly. Example: in_time_zone 'Paris' do order = Order.new original_time = Time.local(2012, 10, 10) order.shipped_at = original_time order.save order.changed? # => false # changing value order.shipped_at = Time.local(2013, 1, 1) order.changed? # => true # reverting to original value order.shipped_at = original_time order.changed? # => false, used to return true end
* | `#count` in conjunction with `#uniq` performs distinct count.Yves Senn2013-01-261-0/+4
| | | | | | | | closes #6865
* | Remove obsolete test fileJon Leighton2013-01-251-35/+0
| | | | | | | | https://github.com/rails/rails/commit/4beb4dececcf10c642c74fbcb8548c833e921a86#commitcomment-2482869
* | reduce the number of queries on IN clauses, fix relation queries in `where`Aaron Patterson2013-01-241-1/+14
| |
* | Describing the reason for defining BlankTopic#blank? which will never be calledAkira Matsuda2013-01-241-0/+1
| |
* | Revert "Unused methods, module, etc."Akira Matsuda2013-01-244-0/+28
| | | | | | | | | | | | This reverts commit 4e05bfb8e254c3360a3ca4a6cb332995314338fe. Reason: BlankTopic#blank? should not be removed to check that dynamic finder with a bang can find a model that responds to `blank?`
* | Unused methods, module, etc.Akira Matsuda2013-01-244-28/+0
| |
* | Set Thread.abort_on_exception for the whole AS, AP, and AR testsAkira Matsuda + Koichi Sasada2013-01-241-0/+2
| | | | | | | | this would give us some more clues in case a test silently dies inside Thread
* | Unused test modelAkira Matsuda2013-01-241-5/+0
| |
* | Goodbye there, very special rubbish!Akira Matsuda2013-01-244-19/+1
| |
* | proxy_{owner,reflection,target} are no more availableAkira Matsuda2013-01-241-11/+1
| |
* | Unused model DeprecatedPostWithCommentAkira Matsuda2013-01-241-7/+0
| |
* | Fix PostgreSQL tests on TravisAndrew White2013-01-242-11/+32
| | | | | | | | Travis only has PostgreSQL 9.1.x but 9.2 is required for range datatypes.
* | Merge pull request #7345 from slbug/masterRafael Mendonça França2013-01-233-118/+295
|\ \ | | | | | | Postgresql range support
| * | Add postgresql range types supportbUg2013-01-233-118/+295
| | |
* | | Remove warning by using a custom coderAndrew White2013-01-231-2/+16
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | The native JSON library bypasses the `to_json` overrides in active_support/core_ext/object/to_json.rb by calling its native implementation directly. However `ActiveRecord::Store` uses a HWIA so `JSON.dump` will call our `to_json` instead with a `State` object for options rather than a `Hash`. This generates a warning when the `:encoding`, `:only` & `:except` keys are accessed in `Hash#as_json` because the `State` object delegates unknown keys to `instance_variable_get` in its `:[]` method. Workaround this warning in the test by using a custom coder that calls `ActiveSupport::JSON.encode` directly.
* | A test case name needs to start with "test_"Akira Matsuda2013-01-231-1/+1
| |
* | Revert "Round usec when writing timestamp attribute."Andrew White2013-01-221-15/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit e9d2ad395ec2ef929d74752f3d71c80674044fbe. Closes #8460 Conflicts: activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb activerecord/test/cases/dirty_test.rb