From acab767c9d042031320b1ed7a7e2faa653ab1bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=A3is=20Ozols?= Date: Mon, 26 Dec 2011 21:44:50 +0200 Subject: Remove unnecessary comma. --- activerecord/lib/active_record/counter_cache.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/counter_cache.rb b/activerecord/lib/active_record/counter_cache.rb index 3c7defedac..031918712a 100644 --- a/activerecord/lib/active_record/counter_cache.rb +++ b/activerecord/lib/active_record/counter_cache.rb @@ -65,7 +65,7 @@ module ActiveRecord # Post.update_counters [10, 15], :comment_count => 1 # # Executes the following SQL: # # UPDATE posts - # # SET comment_count = COALESCE(comment_count, 0) + 1, + # # SET comment_count = COALESCE(comment_count, 0) + 1 # # WHERE id IN (10, 15) def update_counters(id, counters) updates = counters.map do |counter_name, value| -- cgit v1.2.3 From dd72235225977790cb765818734e3b6adfdd4b3d Mon Sep 17 00:00:00 2001 From: Jo Liss Date: Tue, 27 Dec 2011 13:18:34 +0100 Subject: Document that index names are made up of all columns, not just the first. index_name has been using the following expression "index_#{table_name}_on_#{Array.wrap(options[:column]) * '_and_'}" since at least 2006 (bc7f2315), and that's how they come out in my DB. Please check that this is correct before merging into master, perhaps I'm misunderstanding the section I changed. --- .../connection_adapters/abstract/schema_statements.rb | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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 ccbeba061d..20d3b4a1ef 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -301,15 +301,8 @@ module ActiveRecord # Adds a new index to the table. +column_name+ can be a single Symbol, or # an Array of Symbols. # - # The index will be named after the table and the first column name, - # unless you pass :name as an option. - # - # When creating an index on multiple columns, the first column is used as a name - # for the index. For example, when you specify an index on two columns - # [:first, :last], the DBMS creates an index for both columns as well as an - # index for the first column :first. Using just the first name for this index - # makes sense, because you will never have to create a singular index with this - # name. + # The index will be named after the table and the column name(s), unless + # you pass :name as an option. # # ===== Examples # -- cgit v1.2.3 From b92a22e6eb94290bfc2f16743086caeb6e7f3fc5 Mon Sep 17 00:00:00 2001 From: Jo Liss Date: Wed, 28 Dec 2011 15:29:36 +0100 Subject: typo --- activerecord/lib/active_record/relation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 258c1959a0..80b85ce498 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -355,7 +355,7 @@ module ActiveRecord end end - # Destroy an object (or multiple objects) that has the given id, the object is instantiated first, + # Destroy an object (or multiple objects) that has the given id. The object is instantiated first, # therefore all callbacks and filters are fired off before the object is deleted. This method is # less efficient than ActiveRecord#delete but allows cleanup methods and other actions to be run. # -- cgit v1.2.3 From 4cd7c4e8cef756412cb088b959569c06ba25817b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Andr=C3=A9s?= Date: Wed, 28 Dec 2011 15:41:33 +0100 Subject: Fixed formatting of code examples in form_tag_helper.rb --- actionpack/lib/action_view/helpers/form_tag_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 1424a3584d..fb89641a16 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -407,7 +407,7 @@ module ActionView # # submit_tag "Save", :confirm => "Are you sure?" # # => + # # data-confirm="Are you sure?" /> # def submit_tag(value = "Save changes", options = {}) options = options.stringify_keys @@ -451,12 +451,12 @@ module ActionView # content_tag(:strong, 'Ask me!') # end # # => + # # Ask me! + # # # # button_tag "Checkout", :disable_with => "Please wait..." # # => + # # type="submit">Checkout # def button_tag(content_or_options = nil, options = nil, &block) options = content_or_options if block_given? && content_or_options.is_a?(Hash) -- cgit v1.2.3 From a7d3851bdbc030e1eb14b66fd72ad602b6d4348c Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Wed, 28 Dec 2011 10:59:28 -0800 Subject: Documented about using :path option for resources --- actionpack/lib/action_dispatch/routing/mapper.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 2117cb76b5..84f544c546 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1053,6 +1053,13 @@ module ActionDispatch # # The above example will now change /posts/new to /posts/brand_new # + # [:path] + # Allows you to change the path prefix for the resource. + # + # resources :posts, :path => 'postings' + # + # The resource and all segments will now route to /postings instead of /posts + # # [:only] # Only generate routes for the given actions. # -- cgit v1.2.3 From 1fc6036b4b2fe314e30513925fd6b42a2b634b4b Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Thu, 29 Dec 2011 22:58:57 +0530 Subject: revise some doc changes --- actionpack/lib/action_view/helpers/form_tag_helper.rb | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index fb89641a16..bb753ae27a 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -393,21 +393,17 @@ module ActionView # submit_tag "Save edits", :disabled => true # # => # - # # submit_tag "Complete sale", :disable_with => "Please wait..." - # # => + # # => # # submit_tag nil, :class => "form_submit" # # => # # submit_tag "Edit", :disable_with => "Editing...", :class => "edit_button" - # # => + # # => # # submit_tag "Save", :confirm => "Are you sure?" - # # => + # # => # def submit_tag(value = "Save changes", options = {}) options = options.stringify_keys @@ -455,8 +451,7 @@ module ActionView # # # # button_tag "Checkout", :disable_with => "Please wait..." - # # => + # # => # def button_tag(content_or_options = nil, options = nil, &block) options = content_or_options if block_given? && content_or_options.is_a?(Hash) -- cgit v1.2.3