From 2c72a4abde55c595f286defb84b37de1fdffb3a5 Mon Sep 17 00:00:00 2001 From: Jan Xie Date: Sun, 8 Apr 2012 19:21:10 +0800 Subject: fix doc for ActiveSupport::Callbacks::Callback#define_conditional_callback --- activesupport/lib/active_support/callbacks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index 6e36edee4f..2a569d9a9b 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -187,7 +187,7 @@ module ActiveSupport # Compile around filters with conditions into proxy methods # that contain the conditions. # - # For `around_save :filter_name, :if => :condition': + # For `set_callback :save, :around, :filter_name, :if => :condition': # # def _conditional_callback_save_17 # if condition -- cgit v1.2.3 From 8f25db9067b57b84b7c8654af966f97294abb655 Mon Sep 17 00:00:00 2001 From: Gaurish Sharma Date: Mon, 9 Apr 2012 01:41:04 +0530 Subject: Added instructions on port number --- .../generators/rails/app/templates/config/databases/postgresql.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml index f08f86aac3..ea75c9c303 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml @@ -24,6 +24,10 @@ development: # domain socket that doesn't need configuration. Windows does not have # domain sockets, so uncomment these lines. #host: localhost + + # The TCP port the server listens on; 5432 by default. + # Depending upon your configration, port number might be different. + # See your postgresql.conf file & set accordingly #port: 5432 # Schema search path. The server defaults to $user,public -- cgit v1.2.3 From cf03daa5f509e48cf03897163471f3064cf2f5eb Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Mon, 9 Apr 2012 09:48:30 -0400 Subject: Fix code example in generator test case --- railties/lib/rails/generators/test_case.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/railties/lib/rails/generators/test_case.rb b/railties/lib/rails/generators/test_case.rb index d81c4c3e1d..2cb34fab7a 100644 --- a/railties/lib/rails/generators/test_case.rb +++ b/railties/lib/rails/generators/test_case.rb @@ -135,7 +135,7 @@ module Rails # Asserts a given migration does not exist. You need to supply an absolute path or a # path relative to the configured destination: # - # assert_no_file "config/random.rb" + # assert_no_migration "db/migrate/create_products.rb" # def assert_no_migration(relative) file_name = migration_file_name(relative) @@ -182,7 +182,7 @@ module Rails # Asserts the given attribute type gets a proper default value: # - # assert_field_type :string, "MyString" + # assert_field_default_value :string, "MyString" # def assert_field_default_value(attribute_type, value) assert_equal(value, create_generated_attribute(attribute_type).default) -- cgit v1.2.3 From f28f1d70b3f3dd9f694067f7cab2e717e302ee2b Mon Sep 17 00:00:00 2001 From: Patrick Sharp Date: Mon, 9 Apr 2012 08:54:02 -0500 Subject: add instructions for adding additional manifests --- guides/source/asset_pipeline.textile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/guides/source/asset_pipeline.textile b/guides/source/asset_pipeline.textile index 982c4aa096..a8d0ac3077 100644 --- a/guides/source/asset_pipeline.textile +++ b/guides/source/asset_pipeline.textile @@ -290,7 +290,11 @@ In this example +require_self+ is used. This puts the CSS contained within the f NOTE. If you want to use multiple Sass files, you should generally use the "Sass +@import+ rule":http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import instead of these Sprockets directives. Using Sprockets directives all Sass files exist within their own scope, making variables or mixins only available within the document they were defined in. -You can have as many manifest files as you need. For example the +admin.css+ and +admin.js+ manifest could contain the JS and CSS files that are used for the admin section of an application. +You can have as many manifest files as you need. For example the +admin.css+ and +admin.js+ manifest could contain the JS and CSS files that are used for the admin section of an application. In order for the pipeline to know about the additional manifest, it has to be added to application.rb. + + +config.assets.precompile += %w( admin.css ) + The same remarks about ordering made above apply. In particular, you can specify individual files and they are compiled in the order specified. For example, you might concatenate three CSS files together this way: -- cgit v1.2.3 From 729890469d66eefe51d48a81789456f377dd0c07 Mon Sep 17 00:00:00 2001 From: Jonathan Mazin Date: Mon, 9 Apr 2012 15:41:50 -0300 Subject: Fix small markup error; fix incorrect link --- activemodel/README.rdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activemodel/README.rdoc b/activemodel/README.rdoc index 4861b0a002..b989096ed5 100644 --- a/activemodel/README.rdoc +++ b/activemodel/README.rdoc @@ -14,7 +14,7 @@ Model solves this by defining an explicit API. You can read more about the API in ActiveModel::Lint::Tests. Active Model provides a default module that implements the basic API required -to integrate with Action Pack out of the box: +ActiveModel::Model+. +to integrate with Action Pack out of the box: ActiveModel::Model. class Person include ActiveModel::Model @@ -71,7 +71,7 @@ behavior out of the box: This generates +before_create+, +around_create+ and +after_create+ class methods that wrap your create method. - {Learn more}[link:classes/ActiveModel/CallBacks.html] + {Learn more}[link:classes/ActiveModel/Callbacks.html] * Tracking value changes -- cgit v1.2.3 From 02a5847d32a25d9da4084730e888955e7ce9e1db Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 11 Apr 2012 22:37:17 +0530 Subject: fix bad format [ci skip] --- activemodel/README.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activemodel/README.rdoc b/activemodel/README.rdoc index b989096ed5..7d13a0123b 100644 --- a/activemodel/README.rdoc +++ b/activemodel/README.rdoc @@ -30,7 +30,7 @@ to integrate with Action Pack out of the box: ActiveModel::Model. It includes model name introspections, conversions, translations and validations, resulting in a class suitable to be used with Action Pack. -See +ActiveModel::Model+ for more examples. +See ActiveModel::Model for more examples. Active Model also provides the following functionality to have ORM-like behavior out of the box: -- cgit v1.2.3 From 4fb6527e2c8d0c5dd670cc3d9a6184efc8055938 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 11 Apr 2012 22:39:36 +0530 Subject: Revert "add instructions for adding additional manifests" This reverts commit f28f1d70b3f3dd9f694067f7cab2e717e302ee2b. Reason: This is already covered in this guide elsewhere. --- guides/source/asset_pipeline.textile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/guides/source/asset_pipeline.textile b/guides/source/asset_pipeline.textile index a8d0ac3077..982c4aa096 100644 --- a/guides/source/asset_pipeline.textile +++ b/guides/source/asset_pipeline.textile @@ -290,11 +290,7 @@ In this example +require_self+ is used. This puts the CSS contained within the f NOTE. If you want to use multiple Sass files, you should generally use the "Sass +@import+ rule":http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import instead of these Sprockets directives. Using Sprockets directives all Sass files exist within their own scope, making variables or mixins only available within the document they were defined in. -You can have as many manifest files as you need. For example the +admin.css+ and +admin.js+ manifest could contain the JS and CSS files that are used for the admin section of an application. In order for the pipeline to know about the additional manifest, it has to be added to application.rb. - - -config.assets.precompile += %w( admin.css ) - +You can have as many manifest files as you need. For example the +admin.css+ and +admin.js+ manifest could contain the JS and CSS files that are used for the admin section of an application. The same remarks about ordering made above apply. In particular, you can specify individual files and they are compiled in the order specified. For example, you might concatenate three CSS files together this way: -- cgit v1.2.3 From 3bcfa614afa2f03bd5f1d42613aa7c410a4ca0bb Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 11 Apr 2012 22:43:50 +0530 Subject: copy editing [ci skip] --- .../generators/rails/app/templates/config/databases/postgresql.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml index ea75c9c303..467a4e725f 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml @@ -25,9 +25,8 @@ development: # domain sockets, so uncomment these lines. #host: localhost - # The TCP port the server listens on; 5432 by default. - # Depending upon your configration, port number might be different. - # See your postgresql.conf file & set accordingly + # The TCP port the server listens on. Defaults to 5432. + # If your server runs on a different port number, change accordingly. #port: 5432 # Schema search path. The server defaults to $user,public -- cgit v1.2.3 From 63bd01d82fb4b4f62a6842db5edcd60a60efa964 Mon Sep 17 00:00:00 2001 From: Tim Harvey Date: Wed, 11 Apr 2012 17:10:21 -0300 Subject: Grammar fix in 3.2 Release Notes guide Could also be worded 'as an option', but plural made more sense given the mention of ':handlers and :formats'. --- guides/source/3_2_release_notes.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/3_2_release_notes.textile b/guides/source/3_2_release_notes.textile index 0f8fea2bf6..3524ea6595 100644 --- a/guides/source/3_2_release_notes.textile +++ b/guides/source/3_2_release_notes.textile @@ -299,7 +299,7 @@ end h5(#actionview_deprecations). Deprecations -* Passing formats or handlers to render :template and friends like render :template => "foo.html.erb" is deprecated. Instead, you can provide :handlers and :formats directly as an options: render :template => "foo", :formats => [:html, :js], :handlers => :erb. +* Passing formats or handlers to render :template and friends like render :template => "foo.html.erb" is deprecated. Instead, you can provide :handlers and :formats directly as options: render :template => "foo", :formats => [:html, :js], :handlers => :erb. h4. Sprockets -- cgit v1.2.3 From 05ac3921f85663416fe8a4287b05db3284276b24 Mon Sep 17 00:00:00 2001 From: Alfonso Cora Date: Thu, 12 Apr 2012 12:20:12 -0300 Subject: Fixed markup in security guide --- guides/source/security.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/security.textile b/guides/source/security.textile index 747a4d6791..c065529cac 100644 --- a/guides/source/security.textile +++ b/guides/source/security.textile @@ -385,7 +385,7 @@ params[:user] # => {:name => “ow3ned”, :admin => true} So if you create a new user using mass-assignment, it may be too easy to become an administrator. -Note that this vulnerability is not restricted to database columns. Any setter method, unless explicitly protected, is accessible via the attributes= method. In fact, this vulnerability is extended even further with the introduction of nested mass assignment (and nested object forms) in Rails 2.3. The +accepts_nested_attributes_for+ declaration provides us the ability to extend mass assignment to model associations (+has_many+, +has_one+, +has_and_belongs_to_many+). For example: +Note that this vulnerability is not restricted to database columns. Any setter method, unless explicitly protected, is accessible via the attributes= method. In fact, this vulnerability is extended even further with the introduction of nested mass assignment (and nested object forms) in Rails 2.3. The +accepts_nested_attributes_for+ declaration provides us the ability to extend mass assignment to model associations (+has_many+, +has_one+, +has_and_belongs_to_many+). For example: class Person < ActiveRecord::Base -- cgit v1.2.3