aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #24871 from vipulnsward/disable-transaction-failureArthur Nogueira Neves2016-05-061-0/+2
|\ | | | | Fix failures due to transactions
| * We are erroring due to nested transaction failures from mysql on ↵Vipul A M2016-05-061-0/+2
| | | | | | | | | | | | | | | | test_migrate_clears_schema_cache_afterward test. Disable transactions for this test. Fixes #24391
* | Allow the connection adapters to determine the order of bind paramsSean Griffin2016-05-063-4/+46
|/ | | | | | | | | | | | In 5.0 we use bind parameters for limit and offset, while in 4.2 we used the values directly. The code as it was written assumed that limit and offset worked as `LIMIT ? OFFSET ?`. Both Oracle and SQL Server have a different syntax, where the offset is stated before the limit. We delegate this behavior to the connection adapter so that these adapters are able to determine how the bind parameters are flattened based on what order their specification has the various clauses appear. Fixes #24775
* Merge pull request #24869 from vipulnsward/change-exampleRafael França2016-05-051-3/+3
|\ | | | | Change to use a more realistic example [ci skip]
| * Change to use a more realistic example and not giving the impression that ↵Vipul A M2016-05-051-3/+3
| | | | | | | | | | | | | | | | destroy_all is preferred way to destroy related records. This example just wants to demonstrate callback behaviour. [ci skip]
* | Merge pull request #24868 from vipulnsward/delegate_encode_withRafael França2016-05-051-1/+1
|\ \ | |/ |/| delegate encode_with instead of to_yaml, which is deprecated
| * delegate encode_with instead of to_yaml, which is deprecatedVipul A M2016-05-051-1/+1
| |
* | [ci skip] Don't promote SQL interpolation.Kasper Timm Hansen2016-05-051-2/+2
| | | | | | | | | | | | After fb898e9, the `before_destroy` had some code that used SQL interpolation left over. Don't think we should promote that even if the values aren't directly from user input.
* | Merge pull request #24859 from y-yagi/do_not_pass_conditon_to_destroy_allVipul A M2016-05-052-3/+3
|\ \ | | | | | | do not pass conditions to `#destroy_all` [ci skip]
| * | do not pass conditions to `#destroy_all` [ci skip]yuuji.yaginuma2016-05-052-3/+3
| |/ | | | | | | Passing conditions to `#destroy_all` was deprecated in c82c5f8.
* / Fix some typos in comments.Joe Rafaniello2016-05-043-3/+3
|/ | | | [ci skip]
* Followup of #24835Vipul A M2016-05-033-5/+5
| | | | Fix failing tests
* Merge pull request #24833 from Erol/fix-typoप्रथमेश Sonpatki2016-05-031-1/+1
|\ | | | | Fix small typo in Active Record Migrations documentation
| * Fix small typo in Active Record Migrations documentation [ci skip]Erol Fornoles2016-05-031-1/+1
| |
* | remove `empty?` from CHANGELOG [ci skip]yuuji.yaginuma2016-05-031-2/+1
|/ | | | Follow up to 98264a1343fad6bb6637893a37fd571916b4158c
* Do not delegate `AR::Base#empty?` to `all`Sean Griffin2016-05-022-7/+1
| | | | | | | | | | Unlike `one?` and `none?`, `empty?` has interactions with methods outside of enumerable. It also doesn't fit in the same vein. `Topic.any?` makes sense. `Topic.empty?` does not, as `Topic` is not a container. Fixes #24808 Close #24812
* Add `:nodoc:` to `schema_creation` [ci skip]Ryuta Kamizono2016-05-021-1/+1
| | | | | | | `schema_creation` is not public API. https://github.com/rails/rails/blob/v5.0.0.beta4/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L121 https://github.com/rails/rails/blob/v5.0.0.beta4/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L78
* Merge pull request #24713 from tomkadwill/fix_counter_cache_incrementSean Griffin2016-04-303-0/+14
|\ | | | | | | | | Fix counter_cache double increment bug Close #24183
| * Fix counter_cache double increment bugTom Kadwill2016-04-283-0/+14
| |
* | Replace `Rails.version.to_f` with Active RecordJon Moss2016-04-302-1/+5
| | | | | | | | | | Rails should not be explicity mentioned within Active Record, since railties and the Rails ecosystem is not required for use.
* | rm unused requireVipul A M2016-04-291-1/+0
| | | | | | | | Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* | Extract `add_sql_comment!` methodRyuta Kamizono2016-04-293-20/+13
| | | | | | | | | | | | Refactor of #22911. Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* | Treat blank comments as no comment for indexesRyuta Kamizono2016-04-293-6/+11
| | | | | | | | | | | | Follow up of 1683410. Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* | Migrations: move version-finding responsibilityyui-knk2016-04-292-7/+11
| | | | | | | | | | | | | | `ActiveRecord::Migration` needn't know about migration version compatibility lookup. Delegate it to the Compatibility module. Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* | Merge branch 'master' of github.com:rails/docrailsVijay Dev2016-04-292-2/+7
|\ \ | | | | | | | | | | | | Conflicts: guides/source/configuring.md
| * | s/statment/statement/Vipul A M2016-04-241-1/+1
| | |
| * | - Be consistent in providing file locations of schema, model and initializerVipul A M2016-04-131-1/+6
| | | | | | | | | | | | [ci skip]
* | | test the number of times the schema is loadingKeenan Brock2016-04-281-0/+53
| | |
* | | schema_load triggers 2nd schema_load (via locking)Keenan Brock2016-04-281-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | Currently, loading the schema (schema_load) accesses the locking column (locking_column) which defaults the value (reset_locking_column) which invalidates the schema (reload_schema_from_cache) which forces another schema load. Good news: The second schema_load does accesses locking_column, but locking_column is set, so it does not reset_locking_column and it does not trigger an infinite loop. The solution is not invalidate the cache while default locking_column
* | Prep Rails 5 beta 4eileencodes2016-04-272-1/+3
| |
* | Merge pull request #24730 from vipulnsward/move-savepointsRafael França2016-04-252-4/+4
|\ \ | | | | | | Move remaining current_savepoint_name to savepoints module
| * | Move remaining current_savepoint_name to savepoints moduleVipul A M2016-04-252-4/+4
| | |
* | | Dont simply assume a type is a valid database type. This is only always true ↵Vipul A M2016-04-253-1/+16
|/ / | | | | | | | | | | | | in the case of sqlite. Others adapters need to perform a check for validity. Add coverage for mysql2 db type validation
* | Add Expression Indexes and Operator Classes support for PostgreSQLRyuta Kamizono2016-04-2410-38/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example: create_table :users do |t| t.string :name t.index 'lower(name) varchar_pattern_ops' end Fixes #19090. Fixes #21765. Fixes #21819. Fixes #24359. Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* | remove_index do not fetch indexes if name is specifiedSeva Orlov2016-04-243-1/+23
| | | | | | | | | | | | There is no need to fetch all table indexes in remove_index if name is specified. If name is wrong, then StatementInvalid will be raised. Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* | Follow up of #23461Vipul A M2016-04-244-6/+8
| | | | | | | | | | | | | | | | - Rename max to statement_limit - Remove magic number 1000 from everywhere - Defined StatementPool::DEFAULT_STATEMENT_LIMIT and started using it everywhere Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* | Include the Savepoints module in all adapters.Vipul A M2016-04-247-17/+10
| | | | | | | | | | Adapters override `#supports_savepoints?` to return `true` if they support transaction savepoints. Defaults to `false`.
* | :nodoc: internal StatementPool class.Vipul A M2016-04-241-1/+1
| | | | | | | | [ci skip]
* | Merge pull request #23461 from kamipo/prepared_statements_for_mysql2_adapterJeremy Daer2016-04-234-55/+160
|\ \ | | | | | | | | | Add prepared statements support for `Mysql2Adapter`
| * | Add prepared statements support for `Mysql2Adapter`Ryuta Kamizono2016-04-214-56/+159
| | |
* | | Merge pull request #24708 from ↵Jeremy Daer2016-04-232-5/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | kamipo/move_select_rows_implementation_to_super_class Move `select_rows` implementation to super class
| * | | Move `select_rows` implementation to super classRyuta Kamizono2016-04-242-5/+1
| | | |
* | | | Merge pull request #24705 from kamipo/add_nodoc_to_insert_versions_sqlGuillermo Iguaran2016-04-232-2/+2
|\ \ \ \ | | | | | | | | | | Add `:nodoc:` to `insert_versions_sql` [ci skip]
| * | | | Add `:nodoc:` to `insert_versions_sql` [ci skip]Ryuta Kamizono2016-04-242-2/+2
| |/ / / | | | | | | | | | | | | Follow up to #24685. `insert_versions_sql` is not public API.
* | | | Merge pull request #24706 from kamipo/remove_in_doc_about_mysql_versions_below_5Guillermo Iguaran2016-04-231-3/+1
|\ \ \ \ | | | | | | | | | | Remove in the doc about MySQL versions below 5 [ci skip]
| * | | | Remove in the doc about MySQL versions below 5 [ci skip]Ryuta Kamizono2016-04-241-3/+1
| |/ / / | | | | | | | | | | | | | | | | Follow up to #23458. Active Record supports MySQL >= 5.0 now.
* / / / Move `require 'ipaddr'` in `postgresql/oid/cidr.rb`Ryuta Kamizono2016-04-242-2/+2
|/ / / | | | | | | | | | `IPAddr` is used in `OID::Cidr`.
* | | Followup of #15771Vipul A M2016-04-242-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure we handle explicitly passed nil's to lock_version as well. An explicitly passed nil value is now converted to 0 on LockingType, so that we don't end up with ActiveRecord::StaleObjectError in update record optimistic locking Fixes #24695
* | | Schema load: Fix dupe version insertJeremy Daer2016-04-221-1/+1
| | | | | | | | | | | | Re. 6e098284e97250eaed6f30f5c7c362d87da986b0
* | | Merge pull request #24685 from vipulnsward/sqlite-compat-for-multi-insertJeremy Daer2016-04-224-4/+43
|\ \ \ | | | | | | | | | | | | Gracefully fallback on version migrations for sqlite < 3.7.11