aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Removes unneeded caching from ActiveRecord::Base.relation"Philip Arndt2012-05-311-3/+4
| | | | | | | | | | This reverts commit ebfa58abc895c0639211cb896a47b04e424322c8. This change caused a regression in my application's tests: * Failing build http://travis-ci.org/#!/resolve/refinerycms/builds/1461242 Broken tests pass after this change is reverted.
* Merge pull request #6477 from steveklabnik/close_discovered_pg_connectionRafael Mendonça França2012-05-301-1/+2
| | | | Properly discover a connection is closed in postgresql_adapter
* Merge pull request #5810 from kennyj/fix_5797Aaron Patterson2012-05-303-5/+6
| | | | | | Fix #5797. Error calling dup method on AR model with serialized field Conflicts: activerecord/lib/active_record/core.rb
* Merge pull request #5244 from fotos/myqsl2_wait_timeoutRafael Mendonça França2012-05-251-1/+1
| | | | Maximum wait_timeout on Windows is 2147483
* Merge pull request #5925 from Juanmcuello/pg_structure_dumpCarlos Antonio da Silva2012-05-241-2/+2
|\ | | | | Quote arguments in db:structure:dump for PostgreSQL.
| * Use Shellwords to scape arguments in db:structure:dump for PostgreSQL.Juan M. Cuello2012-05-221-2/+2
| | | | | | | | fixes #5913
* | Synchronize the ConnectionPool#release method to avoid thread safety issues ↵Andrew Selder2012-05-231-10/+12
|/ | | | | | | | | | | | | | | | | | | | [#6464] Fixes #6464 Synchronize the contents of the release method in ConnectionPool due to errors when running in high concurrency environments. Detected invalid hash contents due to unsynchronized modifications with concurrent users org/jruby/RubyHash.java:1356:in `keys' /usr/local/rvm/gems/jruby-1.6.7@new_import/gems/activerecord-3.2.3/lib/a ctive_record/connection_adapters/abstract/connection_pool.rb:294:in `release' /usr/local/rvm/gems/jruby-1.6.7@new_import/gems/activerecord-3.2.3/lib/a ctive_record/connection_adapters/abstract/connection_pool.rb:282:in `checkin'
* Restore the frozen state on rollback. Fixes #6417.Godfrey Chan2012-05-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | This is a 3-2-stable backport for #6420 which was merged into master. Currently, when saving a frozen record, an exception would be thrown which causes a rollback. However, there is a bug in active record that "defrost" the record as a side effect: >> t = Topic.new => #<Topic id: nil, ...> >> t.freeze => #<Topic id: nil, ...> >> t.save RuntimeError: can't modify a frozen Hash >> t.frozen? => false >> t.save => true This patch fixes the bug by explictly restoring the frozen state on the attributes Hash after every rollback.
* Postgresql doesn't accept limits on binary (bytea) columns.Victor Costan2012-05-211-8/+19
|
* Fix uniqueness validator with `allow_nil: false` also for mysqlPiotr Sarnacki2012-05-191-1/+1
| | | | | MySQL's adapter was changing value for case sensitive comparison. We don't need to do it for `nil`.
* Fix `validates_uniqueness_off :field, :allow_nil => false`Piotr Sarnacki2012-05-191-2/+2
| | | | | | | | | | | | | | | | | | Closes (#5853) Uniqueness validator was not properly checking if there are any existing records, when value was `nil` and column was text type. `nil` was converted to string, which resulted in queries looking like: ```sql SELECT 1 FROM "posts" WHERE "posts"."title" = '' LIMIT 1 ``` instead of ```sql SELECT 1 FROM "posts" WHERE "posts"."title" IS NULL LIMIT 1 ```
* Merge pull request #6398 from pmahoney/threadsafe-connection-poolAaron Patterson2012-05-191-4/+8
| | | | Synchronize read and modification of @reserved_connections
* Ensure that CollectionAssociation#replace returns proper targetPiotr Sarnacki2012-05-191-1/+1
| | | | | | | | The fix commited in e2a070c was returning the `new_target`, as a try to return whatever user replaced association with. The problem is, the resulting association target may be ordered differently. In such case we want to return the target that will be later used for that association.
* Fix HABTM syntax error in Ruby 1.8.xErnie Miller2012-05-181-2/+2
|
* fix #delete_all with habtm with :delete_sqlJon Leighton2012-05-181-0/+1
|
* Perf: Don't load the association for #delete_all.Jon Leighton2012-05-184-9/+33
| | | | | | | | Bug #6289 Conflicts: activerecord/test/cases/associations/has_many_associations_test.rb
* Fix CollectionAssociation#replace to return new target (closes #6231)Piotr Sarnacki2012-05-161-0/+2
| | | | | | Conflicts: activerecord/test/cases/associations/has_many_associations_test.rb
* Remove unused private method yaml_fixtures_keyAlexey Muranov2012-05-111-3/+0
|
* Return false for exists? with new records - fixes #6199.Andrew White2012-05-101-2/+1
| | | | (cherry picked from commit fa21b73ebb8339ad388f149c817c433b6254d490)
* Merge pull request #6221 from ↵Jeremy Kemper2012-05-091-7/+26
|\ | | | | | | | | alexeymuranov/deprecate__instantiate_fixtures__arity Deprecate ActiveRecord::Fixtures.instantiate_fixtures unused parameter
| * Remove deprecated use of ::instantiate_fixturesAlexey Muranov2012-05-101-4/+4
| |
| * Deprecate ::instantiate_fixtures unused parameterAlexey Muranov2012-05-101-3/+22
| | | | | | | | | | | | Deprecate the use of AcitiveRecord::Fixtures::instantiate_fixtures(object, fixture_set_name, fixture_set, load_instances = true), use instead instantiate_fixtures(object, fixture_set, load_instances = true). To be changed in master branch.
* | Stop showing deprecations for Ruby 1.8.7 with remove_columnCarlos Antonio da Silva2012-05-092-4/+6
|/ | | | | String is Enumerable in 1.8.7, which means that passing a String to remove_column was generating deprecation warnings during tests.
* Merge pull request #6128 from frodsan/delete_all_limit_32Aaron Patterson2012-05-041-0/+2
|\ | | | | Fix #4979 against 3-2-stable
| * Fix #4979 against 3-2-stable - delete_all raise an error if a limit is providedFrancesco Rodriguez2012-05-021-0/+2
| |
* | Deprecate remove_column with array as an argumentPiotr Sarnacki2012-05-022-0/+13
|/
* Be sure to correctly fetch PK name from MySQL even if the PK has some custom ↵Akira Matsuda2012-04-191-1/+1
| | | | | | | | | | | option Backports #5900 Conflicts: activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb
* Removes unneeded caching from ActiveRecord::Base.relationBenedikt Deicke2012-04-191-4/+3
|
* Revert "Revert "Fix #5667. Preloading should ignore scoping.""Benedikt Deicke2012-04-191-2/+3
| | | | | | | | This reverts commit 1166d49f62ccab789be208112163ad13183224e2. Conflicts: activerecord/test/cases/associations/eager_test.rb
* Removes caching from ActiveRecord::Core::ClassMethods#relationBenedikt Deicke2012-04-191-2/+2
| | | | | | | | | | | | | | | The #relation method gets called in four places and the return value was instantly cloned in three of them. The only place that did not clone was ActiveRecord::Scoping::Default::ClassMethods#unscoped. This introduced a bug described in #5667 and should really clone the relation, too. This means all four places would clone the relation, so it doesn't make a lot of sense caching it in the first place. The four places with calls to relations are: activerecord/lib/active_record/scoping/default.rb:110:in `block in build_default_scope'" activerecord/lib/active_record/scoping/default.rb:42:in `unscoped'" activerecord/lib/active_record/scoping/named.rb:38:in `scoped'" activerecord/lib/active_record/scoping/named.rb:52:in `scope_attributes'" Conflicts: activerecord/lib/active_record/core.rb
* Revert "Fix #5667. Preloading should ignore scoping."Jeremy Kemper2012-04-181-3/+2
| | | | | | | | Causes a subtle regression where record.reload includes the default scope. Hard to reproduce in isolation. Seems like the relation is getting infected by some previous usage. This reverts commit dffbb521a0d00c8673a3ad6e0e8ff526f32daf4e.
* Check for nil loggerNorman Clarke2012-04-181-1/+1
|
* Merge pull request #5725 from kevmoo/remove_unused_castcodeXavier Noria2012-04-091-2/+0
|\ | | | | Remove unused castcode
| * Remove unused 'cast_code' variableKevin Moore2012-04-031-2/+0
| |
* | log which config format AR uses to connect withTerence Lee2012-04-031-0/+4
|/
* DATABASE_URL allows omission of database.ymlTim Pope2012-04-031-1/+3
|
* Merge pull request #5662 from arturopie/3-2_fixing_IM_when_using_find_selectAaron Patterson2012-03-302-10/+23
|\ | | | | Fixing Identity Map when using find select in rails 3.2
| * refactor instantiate method in base, so we remove nesting if's which make ↵Arturo Pie2012-03-292-12/+19
| | | | | | | | | | | | | | | | the code harder to read. Minor changes to contain_all_columns in IdentityMap. Conflicts: activerecord/lib/active_record/base.rb
| * refactor the checking of the attributes of the record in IdentityMap#add, so ↵Arturo Pie2012-03-291-1/+7
| | | | | | | | it's more readable
| * Do not add record to identity map if the record doesn't have values for all ↵Arturo Pie2012-03-291-1/+1
| | | | | | | | the columns, so we don't get 'MissingAttributeError' later when trying to access other fields of the same record.
* | Merge branch '3-2-3' into 3-2-stableSantiago Pastorino2012-03-301-1/+1
|\ \
| * | Bump up to 3.2.3Santiago Pastorino2012-03-301-1/+1
| | |
| * | Bumping to 3.2.3.rc2Santiago Pastorino2012-03-291-1/+1
| | |
* | | Fix #5667. Preloading should ignore scoping.Jon Leighton2012-03-301-2/+3
| |/ |/| | | | | | | | | Conflicts: activerecord/test/cases/associations/eager_test.rb
* | Fix #5549.Jon Leighton2012-03-282-3/+7
| |
* | Merge pull request #5616 from cbartlett/migration-indentSantiago Pastorino2012-03-281-2/+2
| | | | | | | | Fix indenting in migration generator
* | Merge pull request #5618 from lest/patch-1Piotr Sarnacki2012-03-271-0/+1
|\ \ | |/ |/| force datetime attributes to be changed
| * force datetime attributes to be changedSergey Nartimov2012-03-271-0/+1
| | | | | | | | backport ddb5d2f756d9d2655a07791a3b62832efd588474 to 3-2-stable
* | Bumping to 3.2.3.rc1Santiago Pastorino2012-03-271-2/+2
| |
* | Merge pull request #2621 from icco/masterAaron Patterson2012-03-261-1/+1
|/ | | | Issue with schema dump