From b46e6416dc6607545e2dea92e6788986b261357c Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Fri, 3 May 2013 01:00:43 -0400 Subject: added to rdoc for unscope that default_scope wins --- activerecord/lib/active_record/relation/query_methods.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 9fcd2d06c5..d020f1ba52 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -340,6 +340,9 @@ module ActiveRecord # User.where(name: "John", active: true).unscope(where: :name) # == User.where(active: true) # + # This method is applied before the default_scope is applied. So the conditions + # specified in default_scope will not be removed. + # # Note that this method is more generalized than ActiveRecord::SpawnMethods#except # because #except will only affect a particular relation's values. It won't wipe # the order, grouping, etc. when that relation is merged. For example: -- cgit v1.2.3 From d9490631d2e5cf99d748541bd9c3c43adcdd6e6c Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Thu, 9 May 2013 02:06:03 -0400 Subject: minor rdoc cleanup for reflection methods --- activerecord/lib/active_record/reflection.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 60eda96f08..d26fb14413 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -398,7 +398,7 @@ module ActiveRecord delegate :foreign_key, :foreign_type, :association_foreign_key, :active_record_primary_key, :type, :to => :source_reflection - # Gets the source of the through reflection. It checks both a singularized + # Returns the source of the through reflection. It checks both a singularized # and pluralized form for :belongs_to or :has_many. # # class Post < ActiveRecord::Base @@ -412,8 +412,7 @@ module ActiveRecord # end # # tags_reflection = Post.reflect_on_association(:tags) - # - # taggings_reflection = tags_reflection.source_reflection + # tags_reflection.source_reflection # # => # def source_reflection @@ -429,7 +428,8 @@ module ActiveRecord # end # # tags_reflection = Post.reflect_on_association(:tags) - # taggings_reflection = tags_reflection.through_reflection + # tags_reflection.through_reflection + # # => # def through_reflection @through_reflection ||= active_record.reflect_on_association(options[:through]) -- cgit v1.2.3 From fe7cf89193bcbb92d1a4dd86e67da9627c20a167 Mon Sep 17 00:00:00 2001 From: aditya-kapoor Date: Thu, 9 May 2013 23:50:05 +0530 Subject: Added documentation for ActiveRecord::Base#next_migration_number --- activerecord/lib/active_record/migration.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 6c020e1d57..4a04748680 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -668,6 +668,11 @@ module ActiveRecord copied end + # Determines the version number of the next migration + # if the timestamped migrations are activated then the comparison with the current time is made + # and then higer of the two values is selected + # For non timestamped values, the simple numbers are used in the format of "057", "570" + def next_migration_number(number) if ActiveRecord::Base.timestamped_migrations [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % number].max -- cgit v1.2.3 From ff34afc202ea5f008a072423f671147897e9d02e Mon Sep 17 00:00:00 2001 From: aditya-kapoor Date: Fri, 10 May 2013 00:03:29 +0530 Subject: Added documentation for ActiveRecord::Generators::MigrationGenerator.next_migration_number --- .../rails/generators/active_record/migration/migration_generator.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/lib') diff --git a/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb b/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb index b967bb6e0f..3968acba64 100644 --- a/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb +++ b/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb @@ -14,6 +14,10 @@ module ActiveRecord protected attr_reader :migration_action, :join_tables + # sets the default migration template that is being used for the generation of the migration + # depending on the arguments which would be sent out in the command line, the migration template + # and the table name instance variables are setup. + def set_local_assigns! @migration_template = "migration.rb" case file_name -- cgit v1.2.3 From 1a9766f1280f9550ba1de4538fccd5ad51c557ac Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Sun, 12 May 2013 15:52:09 +0530 Subject: copy edits [ci skip] --- activerecord/lib/active_record/migration.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 4a04748680..511a1585a7 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -668,11 +668,7 @@ module ActiveRecord copied end - # Determines the version number of the next migration - # if the timestamped migrations are activated then the comparison with the current time is made - # and then higer of the two values is selected - # For non timestamped values, the simple numbers are used in the format of "057", "570" - + # Determines the version number of the next migration. def next_migration_number(number) if ActiveRecord::Base.timestamped_migrations [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % number].max -- cgit v1.2.3