diff options
-rw-r--r-- | guides/source/action_mailer_basics.md | 10 | ||||
-rw-r--r-- | guides/source/upgrading_ruby_on_rails.md | 19 | ||||
-rw-r--r-- | railties/lib/rails/commands/console.rb | 8 | ||||
-rw-r--r-- | railties/lib/rails/commands/server.rb | 18 |
4 files changed, 28 insertions, 27 deletions
diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md index 6b6ce145e4..f981d0da47 100644 --- a/guides/source/action_mailer_basics.md +++ b/guides/source/action_mailer_basics.md @@ -187,13 +187,13 @@ class UsersController < ApplicationController end ``` -NOTE: By default Active Job is configured to execute the job `:inline`. So you can -use `deliver_later` now to send the emails and when you decide to start sending the -email from a background job you'll just have to setup Active Job to use a queueing +NOTE: Active Job's default behavior is to execute jobs ':inline'. So, you can use +`deliver_later` now to send emails, and when you later decide to start sending +them from a background job, you'll only need to set up Active Job to use a queueing backend (Sidekiq, Resque, etc). -If you want to send the emails right away (from a cronjob for example) just -call `deliver_now`: +If you want to send emails right away (from a cronjob for example) just call +`deliver_now`: ```ruby class SendWeeklySummary diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index 8586dc6a62..407445f449 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -148,7 +148,7 @@ Upgrading from Rails 4.0 to Rails 4.1 Or, "whaaat my tests are failing!!!?" Cross-site request forgery (CSRF) protection now covers GET requests with -JavaScript responses, too. That prevents a third-party site from referencing +JavaScript responses, too. This prevents a third-party site from referencing your JavaScript URL and attempting to run it to extract sensitive data. This means that your functional and integration tests that use @@ -199,8 +199,8 @@ secrets, you need to: ``` 2. Use your existing `secret_key_base` from the `secret_token.rb` initializer to - set the SECRET_KEY_BASE environment variable for whichever users run the Rails - app in production mode. Alternately, you can simply copy the existing + set the SECRET_KEY_BASE environment variable for whichever users running the + Rails application in production mode. Alternatively, you can simply copy the existing `secret_key_base` from the `secret_token.rb` initializer to `secrets.yml` under the `production` section, replacing '<%= ENV["SECRET_KEY_BASE"] %>'. @@ -403,8 +403,8 @@ ActiveRecord::FixtureSet.context_class.send :include, FixtureFileHelpers ### I18n enforcing available locales -Rails 4.1 now defaults the I18n option `enforce_available_locales` to `true`, -meaning that it will make sure that all locales passed to it must be declared in +Rails 4.1 now defaults the I18n option `enforce_available_locales` to `true`. This +means that it will make sure that all locales passed to it must be declared in the `available_locales` list. To disable it (and allow I18n to accept *any* locale option) add the following @@ -414,9 +414,10 @@ configuration to your application: config.i18n.enforce_available_locales = false ``` -Note that this option was added as a security measure, to ensure user input could -not be used as locale information unless previously known, so it's recommended not -to disable this option unless you have a strong reason for doing so. +Note that this option was added as a security measure, to ensure user input +cannot be used as locale information unless it is previously known. Therefore, +it's recommended not to disable this option unless you have a strong reason for +doing so. ### Mutator methods called on Relation @@ -524,7 +525,7 @@ Using `render :text` may pose a security risk, as the content is sent as ### PostgreSQL json and hstore datatypes Rails 4.1 will map `json` and `hstore` columns to a string-keyed Ruby `Hash`. -In earlier versions a `HashWithIndifferentAccess` was used. This means that +In earlier versions, a `HashWithIndifferentAccess` was used. This means that symbol access is no longer supported. This is also the case for `store_accessors` based on top of `json` or `hstore` columns. Make sure to use string keys consistently. diff --git a/railties/lib/rails/commands/console.rb b/railties/lib/rails/commands/console.rb index 555d8f31e1..c926620b33 100644 --- a/railties/lib/rails/commands/console.rb +++ b/railties/lib/rails/commands/console.rb @@ -14,16 +14,16 @@ module Rails OptionParser.new do |opt| opt.banner = "Usage: rails console [environment] [options]" - opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |v| options[:sandbox] = v } + opt.on('-s', '--sandbox', 'Rollbacks database modifications on exit.') { |v| options[:sandbox] = v } opt.on("-e", "--environment=name", String, "Specifies the environment to run this console under (test/development/production).", "Default: development") { |v| options[:environment] = v.strip } - opt.on("--debugger", 'Enable the debugger.') do |v| + opt.on("--debugger", 'Enables the debugger.') do |v| if RUBY_VERSION < '2.0.0' options[:debugger] = v else - puts "=> Notice: debugger option is ignored since ruby 2.0 and " \ - "it will be removed in future versions" + puts "=> Notice: debugger option is ignored since Ruby 2.0 and " \ + "it will be removed in future versions." end end opt.parse!(arguments) diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index c3b7bb6f84..ba7e7396ba 100644 --- a/railties/lib/rails/commands/server.rb +++ b/railties/lib/rails/commands/server.rb @@ -20,20 +20,20 @@ module Rails def option_parser(options) OptionParser.new do |opts| - opts.banner = "Usage: rails server [mongrel, thin, etc] [options]" + opts.banner = "Usage: rails server [Mongrel, Thin etc] [options]" opts.on("-p", "--port=port", Integer, "Runs Rails on the specified port.", "Default: 3000") { |v| options[:Port] = v } - opts.on("-b", "--binding=ip", String, - "Binds Rails to the specified ip.", "Default: 0.0.0.0") { |v| options[:Host] = v } + opts.on("-b", "--binding=IP", String, + "Binds Rails to the specified IP.", "Default: 0.0.0.0") { |v| options[:Host] = v } opts.on("-c", "--config=file", String, - "Use custom rackup configuration file") { |v| options[:config] = v } - opts.on("-d", "--daemon", "Make server run as a Daemon.") { options[:daemonize] = true } - opts.on("-u", "--debugger", "Enable the debugger") do + "Uses a custom rackup configuration.") { |v| options[:config] = v } + opts.on("-d", "--daemon", "Runs server as a Daemon.") { options[:daemonize] = true } + opts.on("-u", "--debugger", "Enables the debugger.") do if RUBY_VERSION < '2.0.0' options[:debugger] = true else - puts "=> Notice: debugger option is ignored since ruby 2.0 and " \ - "it will be removed in future versions" + puts "=> Notice: debugger option is ignored since Ruby 2.0 and " \ + "it will be removed in future versions." end end opts.on("-e", "--environment=name", String, @@ -45,7 +45,7 @@ module Rails opts.separator "" - opts.on("-h", "--help", "Show this help message.") { puts opts; exit } + opts.on("-h", "--help", "Shows this help message.") { puts opts; exit } end end end |