aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #9414 from senny/9275_order_with_symbol_and_joinRafael Mendonça França2013-02-262-2/+20
|\ | | | | Expand order(:symbol) to "table".symbol to prevent broken queries on PG.
| * Expand order(:symbol) to "table".symbol to prevent broken queries on PG.Yves Senn2013-02-252-3/+21
| | | | | | | | | | | | | | | | | | | | Fixes #9275. When `#order` is called with a Symbol this patch will prepend the quoted_table_name. Before the postgresql adapter failed to build queries containg a join and an order with a symbol. This expansion happens for all adapters.
* | Do not override attributes on `dup` by default scopesHiroshige Umino2013-02-261-0/+9
| |
* | :scissors:Rafael Mendonça França2013-02-251-1/+1
|/
* Merge pull request #9246 from Noemj/update_prepared_statementsAaron Patterson2013-02-241-0/+14
|\ | | | | Changed update to use prepared statements
| * Changed update_record to use prepared statements.Noemj2013-02-111-0/+14
| |
* | Raising an ActiveRecordError when one tries to use .touch(name) on a newwangjohn2013-02-251-0/+7
| | | | | | | | | | object that has not yet been persisted. This behavior follows the precedent set by update_columns.
* | 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
| | |