From 611020b4dd16799cc836ab15d7a010e6ad48c1ad Mon Sep 17 00:00:00 2001 From: kennyj Date: Fri, 13 Apr 2012 01:25:58 +0900 Subject: Fix typo on the add_index. --- .../lib/active_record/connection_adapters/abstract/schema_statements.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index 0784b2d11a..59ae3ef981 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -375,7 +375,7 @@ module ActiveRecord # Note: SQLite doesn't support index length # # ====== Creating an index with a sort order (desc or asc, asc is the default) - # add_index(:accounts, [:branch_id, :party_id, :surname], :order => {:branch_id => :desc, :part_id => :asc}) + # add_index(:accounts, [:branch_id, :party_id, :surname], :order => {:branch_id => :desc, :party_id => :asc}) # generates # CREATE INDEX by_branch_desc_party ON accounts(branch_id DESC, party_id ASC, surname) # -- cgit v1.2.3 From 820a677d8622a540188704941a31871ed4d61461 Mon Sep 17 00:00:00 2001 From: Rodrigo Flores Date: Thu, 12 Apr 2012 21:51:35 -0300 Subject: Added documentation to explain what happens if you don't set any values for the dependent option on has_many --- activerecord/lib/active_record/associations.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index b901f06ca4..a4753ad8ac 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1097,13 +1097,16 @@ module ActiveRecord # alongside this object by calling their +destroy+ method. If set to :delete_all all associated # objects are deleted *without* calling their +destroy+ method. If set to :nullify all associated # objects' foreign keys are set to +NULL+ *without* calling their +save+ callbacks. If set to - # :restrict an error will be added to the object, preventing its deletion, if any associated + # :restrict an error will be added to the object, preventing its deletion, if any associated # objects are present. # # If using with the :through option, the association on the join model must be # a +belongs_to+, and the records which get deleted are the join records, rather than # the associated records. # + # If you don't set any values, all associated objects remain untouched and with an invalid + # foreign key. + # # [:finder_sql] # Specify a complete SQL statement to fetch the association. This is a good way to go for complex # associations that depend on multiple tables. May be supplied as a string or a proc where interpolation is @@ -1382,7 +1385,7 @@ module ActiveRecord # and +decrement_counter+. The counter cache is incremented when an object of this # class is created and decremented when it's destroyed. This requires that a column # named #{table_name}_count (such as +comments_count+ for a belonging Comment class) - # is used on the associate class (such as a Post class) - that is the migration for + # is used on the associate class (such as a Post class) - that is the migration for # #{table_name}_count is created on the associate class (such that Post.comments_count will # return the count cached, see note below). You can also specify a custom counter # cache column by providing a column name instead of a +true+/+false+ value to this -- cgit v1.2.3 From 944ed4b9606fd44e99cd9fbf79a9a1faad89239c Mon Sep 17 00:00:00 2001 From: Rodrigo Flores Date: Thu, 12 Apr 2012 22:12:08 -0300 Subject: Revert "Added documentation to explain what happens if you don't set any values for the dependent option on has_many" This reverts commit 820a677d8622a540188704941a31871ed4d61461. --- activerecord/lib/active_record/associations.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index a4753ad8ac..b901f06ca4 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1097,16 +1097,13 @@ module ActiveRecord # alongside this object by calling their +destroy+ method. If set to :delete_all all associated # objects are deleted *without* calling their +destroy+ method. If set to :nullify all associated # objects' foreign keys are set to +NULL+ *without* calling their +save+ callbacks. If set to - # :restrict an error will be added to the object, preventing its deletion, if any associated + # :restrict an error will be added to the object, preventing its deletion, if any associated # objects are present. # # If using with the :through option, the association on the join model must be # a +belongs_to+, and the records which get deleted are the join records, rather than # the associated records. # - # If you don't set any values, all associated objects remain untouched and with an invalid - # foreign key. - # # [:finder_sql] # Specify a complete SQL statement to fetch the association. This is a good way to go for complex # associations that depend on multiple tables. May be supplied as a string or a proc where interpolation is @@ -1385,7 +1382,7 @@ module ActiveRecord # and +decrement_counter+. The counter cache is incremented when an object of this # class is created and decremented when it's destroyed. This requires that a column # named #{table_name}_count (such as +comments_count+ for a belonging Comment class) - # is used on the associate class (such as a Post class) - that is the migration for + # is used on the associate class (such as a Post class) - that is the migration for # #{table_name}_count is created on the associate class (such that Post.comments_count will # return the count cached, see note below). You can also specify a custom counter # cache column by providing a column name instead of a +true+/+false+ value to this -- cgit v1.2.3