aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/4_2_release_notes.md54
-rw-r--r--guides/source/_welcome.html.erb2
-rw-r--r--guides/source/association_basics.md2
3 files changed, 32 insertions, 26 deletions
diff --git a/guides/source/4_2_release_notes.md b/guides/source/4_2_release_notes.md
index c3803aa856..848a125bbc 100644
--- a/guides/source/4_2_release_notes.md
+++ b/guides/source/4_2_release_notes.md
@@ -4,7 +4,7 @@ Ruby on Rails 4.2 Release Notes
Highlights in Rails 4.2:
* Active Job
-* Asynchronous Mails
+* Asynchronous mails
* Adequate Record
* Web Console
* Foreign key support
@@ -41,13 +41,23 @@ Jobs written with the Active Job API run on any of the supported queues thanks
to their respective adapters. Active Job comes pre-configured with an inline
runner that executes jobs right away.
-Jobs often need to take Active Record objects as arguments, but we can't pass
-fully-marshaled Ruby objects through many queueing systems. Active Job passes
+Jobs often need to take Active Record objects as arguments. Active Job passes
object references as URIs (uniform resource identifiers) instead of marshaling
the object itself. The new [Global ID](https://github.com/rails/globalid)
library builds URIs and looks up the objects they reference. Passing Active
-Record objects as job arguments "just works:" Active Job passes a reference to
-the object, then looks up the object from its reference.
+Record objects as job arguments just works by using Global ID internally.
+
+For example, if `trashable` is an AR this job runs just fine
+
+```ruby
+class TrashableCleanupJob < ActiveJob::Base
+ def perform(trashable, depth)
+ trashable.cleanup(depth)
+ end
+end
+```
+
+with no serialization involved.
See the [Active Job Basics](active_job_basics.html) guide for more
information.
@@ -109,22 +119,15 @@ The caching is not used in the following scenarios:
### Web Console
-New applications generated from Rails 4.2 now come with the Web Console gem by
-default.
-
-Web Console is a set of debugging tools for your Rails application. It adds an
-interactive console on every error page and a `console` view and controller
-helper.
-
-The interactive console on the error pages lets you execute code where the
-exception originated. It's quite handy being able to introspect the state that
-led to the error.
+New applications generated from Rails 4.2 now come with the [Web
+Console](https://github.com/rails/web-console) gem by default. Web Console adds
+an interactive Ruby console on every error page and provides a `console` view
+and controller helpers.
-The `console` view helper launches an interactive console within the context of
-the view where it is invoked.
-
-The `console` controller helper spawns an interactive console within the
-context of the controller action it was invoked in.
+The interactive console on error pages lets you execute code in the context of
+the place where the exception originated. The `console` helper, if called
+anywhere in a view or controller, launches an interactive console with the final
+context, once rendering has completed.
### Foreign Key Support
@@ -168,7 +171,7 @@ Previously, calling `render "foo/bar"` in a controller action was equivalent to
instead. If you need to render a file, please change your code to use the
explicit form (`render file: "foo/bar"`) instead.
-### `respond_with` / class-level `respond_to`
+### `respond_with` / Class-Level `respond_to`
`respond_with` and the corresponding class-level `respond_to` have been moved
to the [responders](https://github.com/plataformatec/responders) gem. Add
@@ -250,8 +253,13 @@ application is using any of these spellings, you will need to update them:
non-alphanumeric characters.
```
- a[href=/] => a[href="/"]
- a[href$=/] => a[href$="/"]
+ # before
+ a[href=/]
+ a[href$=/]
+
+ # now
+ a[href="/"]
+ a[href$="/"]
```
* DOMs built from HTML source containing invalid HTML with improperly
diff --git a/guides/source/_welcome.html.erb b/guides/source/_welcome.html.erb
index f2315bfe22..614d69ecdd 100644
--- a/guides/source/_welcome.html.erb
+++ b/guides/source/_welcome.html.erb
@@ -15,5 +15,5 @@
</p>
<% end %>
<p>
- The guides for earlier releases: <a href="http://guides.rubyonrails.org/v4.1.6/">Rails 4.1.6</a>, <a href="http://guides.rubyonrails.org/v4.0.10/">Rails 4.0.10</a>, <a href="http://guides.rubyonrails.org/v3.2.19/">Rails 3.2.19</a> and <a href="http://guides.rubyonrails.org/v2.3.11/">Rails 2.3.11</a>.
+ The guides for earlier releases: <a href="http://guides.rubyonrails.org/v4.1.8/">Rails 4.1.8</a>, <a href="http://guides.rubyonrails.org/v4.0.12/">Rails 4.0.12</a>, <a href="http://guides.rubyonrails.org/v3.2.21/">Rails 3.2.21</a> and <a href="http://guides.rubyonrails.org/v2.3.11/">Rails 2.3.11</a>.
</p>
diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md
index 61490ceb54..a12f5638e3 100644
--- a/guides/source/association_basics.md
+++ b/guides/source/association_basics.md
@@ -1532,8 +1532,6 @@ Controls what happens to the associated objects when their owner is destroyed:
* `:restrict_with_exception` causes an exception to be raised if there are any associated records
* `:restrict_with_error` causes an error to be added to the owner if there are any associated objects
-NOTE: This option is ignored when you use the `:through` option on the association.
-
##### `:foreign_key`
By convention, Rails assumes that the column used to hold the foreign key on the other model is the name of this model with the suffix `_id` added. The `:foreign_key` option lets you set the name of the foreign key directly: