Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rails/docrails
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaydev committed Sep 12, 2013
2 parents ab5cd54 + 3199b84 commit d262773
Show file tree
Hide file tree
Showing 11 changed files with 293 additions and 129 deletions.
20 changes: 10 additions & 10 deletions actionpack/lib/action_dispatch/routing/mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,10 @@ def root(options = {})
#
# match 'json_only', constraints: { format: 'json' }
#
# class Blacklist
# class Whitelist
# def matches?(request) request.remote_ip == '1.2.3.4' end
# end
# match 'path', to: 'c#a', constraints: Blacklist.new
# match 'path', to: 'c#a', constraints: Whitelist.new
#
# See <tt>Scoping#constraints</tt> for more examples with its scope
# equivalent.
Expand Down Expand Up @@ -1063,18 +1063,18 @@ def resources_path_names(options)
# a singular resource to map /profile (rather than /profile/:id) to
# the show action:
#
# resource :geocoder
# resource :profile
#
# creates six different routes in your application, all mapping to
# the +GeoCoders+ controller (note that the controller is named after
# the +Profiles+ controller (note that the controller is named after
# the plural):
#
# GET /geocoder/new
# POST /geocoder
# GET /geocoder
# GET /geocoder/edit
# PATCH/PUT /geocoder
# DELETE /geocoder
# GET /profile/new
# POST /profile
# GET /profile
# GET /profile/edit
# PATCH/PUT /profile
# DELETE /profile
#
# === Options
# Takes same options as +resources+.
Expand Down
12 changes: 6 additions & 6 deletions guides/source/4_0_release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Documentation
Railties
--------

Please refer to the [Changelog](https://github.com/rails/rails/blob/master/railties/CHANGELOG.md) for detailed changes.
Please refer to the [Changelog](https://github.com/rails/rails/blob/4-0-stable/railties/CHANGELOG.md) for detailed changes.

### Notable changes

Expand All @@ -139,7 +139,7 @@ Please refer to the [Changelog](https://github.com/rails/rails/blob/master/railt
Action Mailer
-------------

Please refer to the [Changelog](https://github.com/rails/rails/blob/master/actionmailer/CHANGELOG.md) for detailed changes.
Please refer to the [Changelog](https://github.com/rails/rails/blob/4-0-stable/actionmailer/CHANGELOG.md) for detailed changes.

### Notable changes

Expand All @@ -148,7 +148,7 @@ Please refer to the [Changelog](https://github.com/rails/rails/blob/master/actio
Active Model
------------

Please refer to the [Changelog](https://github.com/rails/rails/blob/master/activemodel/CHANGELOG.md) for detailed changes.
Please refer to the [Changelog](https://github.com/rails/rails/blob/4-0-stable/activemodel/CHANGELOG.md) for detailed changes.

### Notable changes

Expand All @@ -161,7 +161,7 @@ Please refer to the [Changelog](https://github.com/rails/rails/blob/master/activ
Active Support
--------------

Please refer to the [Changelog](https://github.com/rails/rails/blob/master/activesupport/CHANGELOG.md) for detailed changes.
Please refer to the [Changelog](https://github.com/rails/rails/blob/4-0-stable/activesupport/CHANGELOG.md) for detailed changes.

### Notable changes

Expand Down Expand Up @@ -203,7 +203,7 @@ Please refer to the [Changelog](https://github.com/rails/rails/blob/master/activ
Action Pack
-----------

Please refer to the [Changelog](https://github.com/rails/rails/blob/master/actionpack/CHANGELOG.md) for detailed changes.
Please refer to the [Changelog](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for detailed changes.

### Notable changes

Expand All @@ -215,7 +215,7 @@ Please refer to the [Changelog](https://github.com/rails/rails/blob/master/actio
Active Record
-------------

Please refer to the [Changelog](https://github.com/rails/rails/blob/master/activerecord/CHANGELOG.md) for detailed changes.
Please refer to the [Changelog](https://github.com/rails/rails/blob/4-0-stable/activerecord/CHANGELOG.md) for detailed changes.

### Notable changes

Expand Down
2 changes: 1 addition & 1 deletion guides/source/active_record_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ by underscores. Examples:
| ------------- | -------------- |
| `Post` | `posts` |
| `LineItem` | `line_items` |
| `Deer` | `deer` |
| `Deer` | `deers` |
| `Mouse` | `mice` |
| `Person` | `people` |

Expand Down
16 changes: 10 additions & 6 deletions guides/source/active_record_querying.md
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ WARNING: This method only works with `INNER JOIN`.

Active Record lets you use the names of the [associations](association_basics.html) defined on the model as a shortcut for specifying `JOIN` clause for those associations when using the `joins` method.

For example, consider the following `Category`, `Post`, `Comments` and `Guest` models:
For example, consider the following `Category`, `Post`, `Comment`, `Guest` and `Tag` models:

```ruby
class Category < ActiveRecord::Base
Expand Down Expand Up @@ -1536,18 +1536,21 @@ Person.ids
Existence of Objects
--------------------

If you simply want to check for the existence of the object there's a method called `exists?`. This method will query the database using the same query as `find`, but instead of returning an object or collection of objects it will return either `true` or `false`.
If you simply want to check for the existence of the object there's a method called `exists?`.
This method will query the database using the same query as `find`, but instead of returning an
object or collection of objects it will return either `true` or `false`.

```ruby
Client.exists?(1)
```

The `exists?` method also takes multiple ids, but the catch is that it will return true if any one of those records exists.
The `exists?` method also takes multiple values, but the catch is that it will return `true` if any
one of those records exists.

```ruby
Client.exists?(1,2,3)
Client.exists?(id: [1,2,3])
# or
Client.exists?([1,2,3])
Client.exists?(name: ['John', 'Sergei'])
```

It's even possible to use `exists?` without any arguments on a model or a relation.
Expand All @@ -1556,7 +1559,8 @@ It's even possible to use `exists?` without any arguments on a model or a relati
Client.where(first_name: 'Ryan').exists?
```

The above returns `true` if there is at least one client with the `first_name` 'Ryan' and `false` otherwise.
The above returns `true` if there is at least one client with the `first_name` 'Ryan' and `false`
otherwise.

```ruby
Client.exists?
Expand Down
2 changes: 1 addition & 1 deletion guides/source/active_support_core_extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ NOTE: Defined in `active_support/core_ext/object/with_options.rb`.

### JSON support

Active Support provides a better implemention of `to_json` than the +json+ gem ordinarily provides for Ruby objects. This is because some classes, like +Hash+ and +OrderedHash+ needs special handling in order to provide a proper JSON representation.
Active Support provides a better implementation of `to_json` than the +json+ gem ordinarily provides for Ruby objects. This is because some classes, like +Hash+ and +OrderedHash+ needs special handling in order to provide a proper JSON representation.

Active Support also provides an implementation of `as_json` for the <tt>Process::Status</tt> class.

Expand Down
2 changes: 1 addition & 1 deletion guides/source/contributing_to_ruby_on_rails.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ When working with documentation, please take into account the [API Documentation

NOTE: As explained earlier, ordinary code patches should have proper documentation coverage. Docrails is only used for isolated documentation improvements.

NOTE: To help our CI servers you can add [ci skip] to your documentation commit message to skip build on that commit. Please remember to use it for commits containing only documentation changes.
NOTE: To help our CI servers you should add [ci skip] to your documentation commit message to skip build on that commit. Please remember to use it for commits containing only documentation changes.

WARNING: Docrails has a very strict policy: no code can be touched whatsoever, no matter how trivial or small the change. Only RDoc and guides can be edited via docrails. Also, CHANGELOGs should never be edited in docrails.

Expand Down
2 changes: 1 addition & 1 deletion guides/source/debugging_rails_applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ only evaluated if the output level is the same or included in the allowed level
(i.e. lazy loading). The same code rewritten would be:

```ruby
logger.debug {"Person attibutes hash: #{@person.attributes.inspect}"}
logger.debug {"Person attributes hash: #{@person.attributes.inspect}"}
```

The contents of the block, and therefore the string interpolation, is only
Expand Down
2 changes: 1 addition & 1 deletion guides/source/form_helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ To create this form you will use `form_tag`, `label_tag`, `text_field_tag`, and
This will generate the following HTML:

```html
<form accept-charset="UTF-8" action="/search" method="get">
<form accept-charset="UTF-8" action="/search" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
<label for="q">Search for:</label>
<input id="q" name="q" type="text" />
<input name="commit" type="submit" value="Search" />
Expand Down
Loading

0 comments on commit d262773

Please sign in to comment.