mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge branch 'master' of github.com:lifo/docrails
This commit is contained in:
commit
74e46e5156
6 changed files with 6 additions and 6 deletions
|
@ -1185,7 +1185,7 @@ module ActiveRecord
|
||||||
# has_many :subscribers, :through => :subscriptions, :source => :user
|
# has_many :subscribers, :through => :subscriptions, :source => :user
|
||||||
# has_many :subscribers, :class_name => "Person", :finder_sql => Proc.new {
|
# has_many :subscribers, :class_name => "Person", :finder_sql => Proc.new {
|
||||||
# %Q{
|
# %Q{
|
||||||
# SELECT DISTINCT people.*
|
# SELECT DISTINCT *
|
||||||
# FROM people p, post_subscriptions ps
|
# FROM people p, post_subscriptions ps
|
||||||
# WHERE ps.post_id = #{id} AND ps.person_id = p.id
|
# WHERE ps.post_id = #{id} AND ps.person_id = p.id
|
||||||
# ORDER BY p.first_name
|
# ORDER BY p.first_name
|
||||||
|
|
|
@ -569,7 +569,7 @@ TODO: Registering gems on "Tilt":https://github.com/rtomayko/tilt enabling Sproc
|
||||||
|
|
||||||
h3. Upgrading from Old Versions of Rails
|
h3. Upgrading from Old Versions of Rails
|
||||||
|
|
||||||
There are two issues when upgrading. The first is moving the files to the new locations. See the section above for guidance on the correct locations for different file types.
|
There are two issues when upgrading. The first is moving the files to the new locations. See "Asset Organization":#asset-organization above for guidance on the correct locations for different file types.
|
||||||
|
|
||||||
The second is updating the various environment files with the correct default options. The following changes reflect the defaults in version 3.1.0.
|
The second is updating the various environment files with the correct default options. The following changes reflect the defaults in version 3.1.0.
|
||||||
|
|
||||||
|
|
|
@ -465,7 +465,7 @@ Now you should know where you are in the running trace and be able to print the
|
||||||
|
|
||||||
Use +step+ (abbreviated +s+) to continue running your program until the next logical stopping point and return control to ruby-debug.
|
Use +step+ (abbreviated +s+) to continue running your program until the next logical stopping point and return control to ruby-debug.
|
||||||
|
|
||||||
TIP: You can also use +step+ _n_+ and +step- _n_+ to move forward or backward _n_ steps respectively.
|
TIP: You can also use <tt>step<plus> n</tt> and <tt>step- n</tt> to move forward or backward +n+ steps respectively.
|
||||||
|
|
||||||
You may also use +next+ which is similar to step, but function or method calls that appear within the line of code are executed without stopping. As with step, you may use plus sign to move _n_ steps.
|
You may also use +next+ which is similar to step, but function or method calls that appear within the line of code are executed without stopping. As with step, you may use plus sign to move _n_ steps.
|
||||||
|
|
||||||
|
|
|
@ -825,7 +825,7 @@ h5. Active Record Methods
|
||||||
|
|
||||||
* +ActiveRecord::Errors#generate_message+ (which is used by Active Record validations but may also be used manually) uses +model_name.human+ and +human_attribute_name+ (see above). It also translates the error message and supports translations for inherited class names as explained above in "Error message scopes".
|
* +ActiveRecord::Errors#generate_message+ (which is used by Active Record validations but may also be used manually) uses +model_name.human+ and +human_attribute_name+ (see above). It also translates the error message and supports translations for inherited class names as explained above in "Error message scopes".
|
||||||
|
|
||||||
*+ ActiveRecord::Errors#full_messages+ prepends the attribute name to the error message using a separator that will be looked up from "activerecord.errors.format.separator":https://github.com/rails/rails/blob/master/actionpack/lib/action_view/locale/en.yml#L91 (and which defaults to +' '+).
|
* +ActiveRecord::Errors#full_messages+ prepends the attribute name to the error message using a separator that will be looked up from "activerecord.errors.format.separator":https://github.com/rails/rails/blob/master/actionpack/lib/action_view/locale/en.yml#L91 (and which defaults to +' '+).
|
||||||
|
|
||||||
h5. Active Support Methods
|
h5. Active Support Methods
|
||||||
|
|
||||||
|
|
|
@ -495,7 +495,7 @@ def show
|
||||||
end
|
end
|
||||||
</ruby>
|
</ruby>
|
||||||
|
|
||||||
Make sure to use +and return+ and not +&& return+, since +&& return+ will not work due to the operator precedence in the Ruby Language.
|
Make sure to use +and return+ instead of +&& return+ because +&& return+ will not work due to the operator precedence in the Ruby Language.
|
||||||
|
|
||||||
Note that the implicit render done by ActionController detects if +render+ has been called, so the following will work without errors:
|
Note that the implicit render done by ActionController detects if +render+ has been called, so the following will work without errors:
|
||||||
|
|
||||||
|
|
|
@ -655,7 +655,7 @@ You can use the +:constraints+ option to specify a required format on the implic
|
||||||
resources :photos, :constraints => {:id => /[A-Z][A-Z][0-9]+/}
|
resources :photos, :constraints => {:id => /[A-Z][A-Z][0-9]+/}
|
||||||
</ruby>
|
</ruby>
|
||||||
|
|
||||||
This declaration constraints the +:id+ parameter to match the supplied regular expression. So, in this case, the router would no longer match +/photos/1+ to this route. Instead, +/photos/RR27+ would match.
|
This declaration constrains the +:id+ parameter to match the supplied regular expression. So, in this case, the router would no longer match +/photos/1+ to this route. Instead, +/photos/RR27+ would match.
|
||||||
|
|
||||||
You can specify a single constraint to apply to a number of routes by using the block form:
|
You can specify a single constraint to apply to a number of routes by using the block form:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue