From 5fe5effe32e47a5108adf8f58df42e9cbc910c7b Mon Sep 17 00:00:00 2001 From: Hendy Tanata Date: Sun, 18 Dec 2011 00:52:22 -0800 Subject: Improve doc for ActiveRecord::Base.unscoped. --- activerecord/lib/active_record/scoping/default.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/scoping/default.rb b/activerecord/lib/active_record/scoping/default.rb index 9840cbccae..6b5070808a 100644 --- a/activerecord/lib/active_record/scoping/default.rb +++ b/activerecord/lib/active_record/scoping/default.rb @@ -12,7 +12,7 @@ module ActiveRecord end module ClassMethods - # Returns a scope for this class without taking into account the default_scope. + # Returns a scope for the model without the default_scope. # # class Post < ActiveRecord::Base # def self.default_scope @@ -23,18 +23,20 @@ module ActiveRecord # Post.all # Fires "SELECT * FROM posts WHERE published = true" # Post.unscoped.all # Fires "SELECT * FROM posts" # - # This method also accepts a block meaning that all queries inside the block will + # This method also accepts a block. All queries inside the block will # not use the default_scope: # # Post.unscoped { # Post.limit(10) # Fires "SELECT * FROM posts LIMIT 10" # } # - # It is recommended to use block form of unscoped because chaining unscoped with scope - # does not work. Assuming that published is a scope following two statements are same. + # It is recommended to use the block form of unscoped because chaining + # unscoped with scope does not work. Assuming that + # published is a scope, the following two statements + # are equal: the default_scope is applied on both. # - # Post.unscoped.published - # Post.published + # Post.unscoped.published + # Post.published def unscoped #:nodoc: block_given? ? relation.scoping { yield } : relation end -- cgit v1.2.3 From 2bc8e5713764b2276036fecfd7f297132597fddb Mon Sep 17 00:00:00 2001 From: Paco Guzman Date: Sun, 18 Dec 2011 11:17:13 +0100 Subject: Update master changelogs with rails 3.0-stable branch info --- activerecord/CHANGELOG.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'activerecord') diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index cd8e50b33a..578a7456a7 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -583,6 +583,58 @@ *Aaron Patterson* +## Rails 3.0.12 (unreleased) ## + +* No changes. + + +## Rails 3.0.11 (November 18, 2011) ## + +* Exceptions from database adapters should not lose their backtrace. + +* Backport "ActiveRecord::Persistence#touch should not use default_scope" (GH #1519) + +* Psych errors with poor yaml formatting are proxied. Fixes GH #2645 and + GH #2731 + +* Fix ActiveRecord#exists? when passsed a nil value + + +## Rails 3.0.10 (August 16, 2011) ## + +* Magic encoding comment added to schema.rb files + +* schema.rb is written as UTF-8 by default. + +* Ensuring an established connection when running `rake db:schema:dump` + +* Association conditions will not clobber join conditions. + +* Destroying a record will destroy the HABTM record before destroying itself. + GH #402. + +* Make `ActiveRecord::Batches#find_each` to not return `self`. + +* Update `table_exists?` in PG to to always use current search_path or schema if explictly set. + + +## Rails 3.0.9 (June 16, 2011) ## + +* No changes. + + +## Rails 3.0.8 (June 7, 2011) ## + +* Fix various problems with using :primary_key and :foreign_key options in conjunction with + :through associations. [Jon Leighton] + +* Correctly handle inner joins on polymorphic relationships. + +* Fixed infinity and negative infinity cases in PG date columns. + +* Creating records with invalid associations via `create` or `save` will no longer raise exceptions. + + ## Rails 3.0.7 (April 18, 2011) ## * Destroying records via nested attributes works independent of reject_if LH #6006 *Durran Jordan* -- cgit v1.2.3 From aa0286ecbc7ddbb386590274c8756e5364415b9e Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Sun, 18 Dec 2011 19:36:32 +0530 Subject: Revert "Update master changelogs with rails 3.0-stable branch info" This reverts commit 2bc8e5713764b2276036fecfd7f297132597fddb. Reason: Changelogs are not meant to be changed in docrails. --- activerecord/CHANGELOG.md | 52 ----------------------------------------------- 1 file changed, 52 deletions(-) (limited to 'activerecord') diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 578a7456a7..cd8e50b33a 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -583,58 +583,6 @@ *Aaron Patterson* -## Rails 3.0.12 (unreleased) ## - -* No changes. - - -## Rails 3.0.11 (November 18, 2011) ## - -* Exceptions from database adapters should not lose their backtrace. - -* Backport "ActiveRecord::Persistence#touch should not use default_scope" (GH #1519) - -* Psych errors with poor yaml formatting are proxied. Fixes GH #2645 and - GH #2731 - -* Fix ActiveRecord#exists? when passsed a nil value - - -## Rails 3.0.10 (August 16, 2011) ## - -* Magic encoding comment added to schema.rb files - -* schema.rb is written as UTF-8 by default. - -* Ensuring an established connection when running `rake db:schema:dump` - -* Association conditions will not clobber join conditions. - -* Destroying a record will destroy the HABTM record before destroying itself. - GH #402. - -* Make `ActiveRecord::Batches#find_each` to not return `self`. - -* Update `table_exists?` in PG to to always use current search_path or schema if explictly set. - - -## Rails 3.0.9 (June 16, 2011) ## - -* No changes. - - -## Rails 3.0.8 (June 7, 2011) ## - -* Fix various problems with using :primary_key and :foreign_key options in conjunction with - :through associations. [Jon Leighton] - -* Correctly handle inner joins on polymorphic relationships. - -* Fixed infinity and negative infinity cases in PG date columns. - -* Creating records with invalid associations via `create` or `save` will no longer raise exceptions. - - ## Rails 3.0.7 (April 18, 2011) ## * Destroying records via nested attributes works independent of reject_if LH #6006 *Durran Jordan* -- cgit v1.2.3 From 7d11c12958acf28ffb27d7e11a9c7f5b1418e77f Mon Sep 17 00:00:00 2001 From: Kristian Freeman Date: Mon, 19 Dec 2011 19:40:06 -0800 Subject: Updated RUNNING_UNIT_TESTS --- activerecord/RUNNING_UNIT_TESTS | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/RUNNING_UNIT_TESTS b/activerecord/RUNNING_UNIT_TESTS index 6a2e23b01f..c27b22b1ea 100644 --- a/activerecord/RUNNING_UNIT_TESTS +++ b/activerecord/RUNNING_UNIT_TESTS @@ -1,7 +1,10 @@ == Configure databases -Copy test/config.example.yml to test/config.yml and edit as needed. Or just run the tests for -the first time, which will do the copy automatically and use the default (sqlite3). +Copy test/config.example.yml to test/config.yml and edit as needed: + + $ cp config.example.yml config.yml + +Or just run the tests for the first time, which will do the copy automatically and use the default (sqlite3). You can build postgres and mysql databases using the build_postgresql and build_mysql rake tasks. -- cgit v1.2.3 From dcbbfd745c968812dea0edd7671fc95ea5c8a7eb Mon Sep 17 00:00:00 2001 From: Kristian Freeman Date: Mon, 19 Dec 2011 20:06:12 -0800 Subject: Revert "Updated RUNNING_UNIT_TESTS" cp is not a valid command in DOS systems. This reverts commit 7d11c12958acf28ffb27d7e11a9c7f5b1418e77f. --- activerecord/RUNNING_UNIT_TESTS | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'activerecord') diff --git a/activerecord/RUNNING_UNIT_TESTS b/activerecord/RUNNING_UNIT_TESTS index c27b22b1ea..6a2e23b01f 100644 --- a/activerecord/RUNNING_UNIT_TESTS +++ b/activerecord/RUNNING_UNIT_TESTS @@ -1,10 +1,7 @@ == Configure databases -Copy test/config.example.yml to test/config.yml and edit as needed: - - $ cp config.example.yml config.yml - -Or just run the tests for the first time, which will do the copy automatically and use the default (sqlite3). +Copy test/config.example.yml to test/config.yml and edit as needed. Or just run the tests for +the first time, which will do the copy automatically and use the default (sqlite3). You can build postgres and mysql databases using the build_postgresql and build_mysql rake tasks. -- cgit v1.2.3