Skip to content

Commit

Permalink
Remove double spaces in code examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny committed May 28, 2013
1 parent 606c09b commit 70b302b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions guides/source/2_3_release_notes.md
Expand Up @@ -173,8 +173,8 @@ before_save :update_credit_rating, :if => :active,
Rails now has a `:having` option on find (as well as on `has_many` and `has_and_belongs_to_many` associations) for filtering records in grouped finds. As those with heavy SQL backgrounds know, this allows filtering based on grouped results:

```ruby
developers = Developer.find(:all, :group => "salary",
:having => "sum(salary) > 10000", :select => "salary")
developers = Developer.find(:all, :group => "salary",
:having => "sum(salary) > 10000", :select => "salary")
```

* Lead Contributor: [Emilio Tagua](http://github.com/miloops)
Expand Down
2 changes: 1 addition & 1 deletion guides/source/active_record_querying.md
Expand Up @@ -1229,7 +1229,7 @@ One important caveat is that `default_scope` will be overridden by

```ruby
class User < ActiveRecord::Base
default_scope { where state: 'pending' }
default_scope { where state: 'pending' }
scope :active, -> { where state: 'active' }
scope :inactive, -> { where state: 'inactive' }
end
Expand Down
2 changes: 1 addition & 1 deletion guides/source/form_helpers.md
Expand Up @@ -885,7 +885,7 @@ end
:name => 'John Doe',
:addresses_attributes => {
'0' => {
:kind => 'Home',
:kind => 'Home',
:street => '221b Baker Street',
},
'1' => {
Expand Down
2 changes: 1 addition & 1 deletion guides/source/i18n.md
Expand Up @@ -174,7 +174,7 @@ end
# in your /etc/hosts file to try this out locally
def extract_locale_from_tld
parsed_locale = request.host.split('.').last
I18n.available_locales.include?(parsed_locale.to_sym) ? parsed_locale : nil
I18n.available_locales.include?(parsed_locale.to_sym) ? parsed_locale : nil
end
```

Expand Down
10 changes: 5 additions & 5 deletions guides/source/initialization.md
Expand Up @@ -36,8 +36,8 @@ This file is as follows:

```ruby
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands'
```

Expand Down Expand Up @@ -373,7 +373,7 @@ The `options[:config]` value defaults to `config.ru` which contains this:
```ruby
# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment', __FILE__)
require ::File.expand_path('../config/environment', __FILE__)
run <%= app_const %>
```
Expand All @@ -388,7 +388,7 @@ app = eval "Rack::Builder.new {( " + cfgfile + "\n )}.to_app",
The `initialize` method of `Rack::Builder` will take the block here and execute it within an instance of `Rack::Builder`. This is where the majority of the initialization process of Rails happens. The `require` line for `config/environment.rb` in `config.ru` is the first to run:
```ruby
require ::File.expand_path('../config/environment', __FILE__)
require ::File.expand_path('../config/environment', __FILE__)
```
### `config/environment.rb`
Expand Down Expand Up @@ -546,7 +546,7 @@ def self.run(app, options={})
else
server.register('/', Rack::Handler::Mongrel.new(app))
end
yield server if block_given?
yield server if block_given?
server.run.join
end
```
Expand Down
2 changes: 1 addition & 1 deletion guides/source/migrations.md
Expand Up @@ -877,7 +877,7 @@ end
# app/models/product.rb
class Product < ActiveRecord::Base
validates :flag, inclusion: { in: [true, false] }
validates :flag, inclusion: { in: [true, false] }
validates :fuzz, presence: true
end
```
Expand Down
2 changes: 1 addition & 1 deletion guides/source/rails_on_rack.md
Expand Up @@ -82,7 +82,7 @@ To use `rackup` instead of Rails' `rails server`, you can put the following insi

```ruby
# Rails.root/config.ru
require ::File.expand_path('../config/environment', __FILE__)
require ::File.expand_path('../config/environment', __FILE__)

use Rack::Debugger
use Rack::ContentLength
Expand Down

0 comments on commit 70b302b

Please sign in to comment.