aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
Commit message (Collapse)AuthorAgeFilesLines
* Remove warningRafael Mendonça França2013-02-241-1/+1
|
* don't apply invalid ordering when preloading hmt associations.Yves Senn2013-02-241-0/+5
| | | | | | | | | | | | | | | closes #8663. When preloading a hmt association there two possible scenarios: 1.) preload with 2 queries: first hm association, then hmt with id IN () 2.) preload with join: hmt association is loaded with a join on the hm association The bug was happening in scenario 1.) with a normal order clause on the hmt association. The ordering was also applied when loading the hm association, which resulted in the error. This patch only applies the ordering the the hm-relation if we are performing a join (2). Otherwise the order will only appear in the second query (1).
* Merge pull request #9400 from senny/remove_auto_explain_threshold_in_secondsXavier Noria2013-02-241-68/+4
|\ | | | | remove config.auto_explain_threshold_in_seconds
| * remove AR auto-explain (config.auto_explain_threshold_in_seconds)Yves Senn2013-02-241-68/+4
| | | | | | | | | | | | | | | | | | | | We discussed that the auto explain feature is rarely used. This PR removes only the automatic explain. You can still display the explain output for any given relation using `ActiveRecord::Relation#explain`. As a side-effect this should also fix the connection problem during asset compilation (#9385). The auto explain initializer in the `ActiveRecord::Railtie` forced a connection.
* | Skip connection url test when the machine is using socket configuration.Rafael Mendonça França2013-02-241-0/+3
| | | | | | | | The connection url parssing don't accept the socket option
* | Do not type cast all the database url values.Rafael Mendonça França2013-02-241-21/+0
|/ | | | | | We should only type cast when we need to use. Related to 4b005fb371c2e7af80df7da63be94509b1db038c
* Merge pull request #9356 from senny/988_multiple_actions_for_after_commitSteve Klabnik2013-02-241-0/+35
|\ | | | | multiple actions for :on option with `after_commit` and `after_rollback`
| * multiple actions for :on option with `after_commit` and `after_rollback`Yves Senn2013-02-211-0/+35
| | | | | | | | Closes #988.
* | test case to prevent duplicated associations with custom PK.Yves Senn2013-02-242-0/+12
| | | | | | | | closes #9201
* | Oracle enhanced adapter shortens its name if it is longer than 30 bytesYasuo Honda2013-02-241-2/+10
| | | | | | | | because of Oracle database index length spec.
* | also rename the test-case class inside columns_test.rbYves Senn2013-02-241-1/+1
| |
* | rename_column_test.rb -> columns_test.rb to reveal intent.Yves Senn2013-02-231-0/+0
| | | | | | | | | | | | | | | | I renamed the test to better communicate it's intention. Since it also tests: - add_column - remove_column - change_column There is no reason to call it rename_column_test.
* | forwardport #9388 rename/remove column preserves custom PK.Yves Senn2013-02-231-1/+15
|/
* Fix warningRafael Mendonça França2013-02-211-1/+1
|
* Skip failing test and add a FIXME noteRafael Mendonça França2013-02-201-0/+2
|
* also rename indexes when a table or column is renamedYves Senn2013-02-202-3/+34
| | | | When a table or a column is renamed related indexes kept their name. This will lead to confusing names. This patch renames related indexes when a column or a table is renamed. Only indexes with names generated by rails will be renamed. Indexes with custom names will not be renamed.
* reserve index name chars for internal rails operationsYves Senn2013-02-202-5/+34
| | | | | | | | | | | Some adapter (SQLite3) need to perform renaming operations to support the rails DDL. These rename prefixes operate with prefixes. When an index name already uses up the full space provieded by `index_name_length` these internal operations will fail. This patch introduces `allowed_index_name_length` which respects the amount of characters used for internal operations. It will always be <= `index_name_length` and every adapter can define how many characters need to be reserved.
* Merge pull request #9332 from ↵Rafael Mendonça França2013-02-201-0/+16
|\ | | | | | | | | wangjohn/adding_documentation_to_error_raising_in_query_methods Tests to make sure empty arguments in WhereChain raise errors
| * Added comments about the check_empty_arguments method which is calledwangjohn2013-02-201-0/+16
| | | | | | | | | | for query methods in a where_clause. Also, modified the CHANGELOG entry because it had false information and added tests.
* | Reduced memory leak problem in transactions by lazily updating AR objects ↵wangjohn2013-02-201-2/+2
|/ | | | with new transaction state. If AR object has a callback, the callback will be performed immediately (non-lazily) so the transaction still has to keep records with callbacks.
* 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
| |