Skip to content

Commit

Permalink
Merge docrails
Browse files Browse the repository at this point in the history
  • Loading branch information
lifo committed Feb 1, 2009
1 parent 3be0ad6 commit 886124e
Show file tree
Hide file tree
Showing 31 changed files with 4,704 additions and 952 deletions.
9 changes: 5 additions & 4 deletions activerecord/lib/active_record/associations.rb
Expand Up @@ -1166,11 +1166,12 @@ def belongs_to(association_id, options = {})
# [:foreign_key]
# Specify the foreign key used for the association. By default this is guessed to be the name
# of this class in lower-case and "_id" suffixed. So a Person class that makes a +has_and_belongs_to_many+ association
# will use "person_id" as the default <tt>:foreign_key</tt>.
# to Project will use "person_id" as the default <tt>:foreign_key</tt>.
# [:association_foreign_key]
# Specify the association foreign key used for the association. By default this is
# guessed to be the name of the associated class in lower-case and "_id" suffixed. So if the associated class is Project,
# the +has_and_belongs_to_many+ association will use "project_id" as the default <tt>:association_foreign_key</tt>.
# Specify the foreign key used for the association on the receiving side of the association.
# By default this is guessed to be the name of the associated class in lower-case and "_id" suffixed.
# So if a Person class makes a +has_and_belongs_to_many+ association to Project,
# the association will use "project_id" as the default <tt>:association_foreign_key</tt>.
# [:conditions]
# Specify the conditions that the associated object must meet in order to be included as a +WHERE+
# SQL fragment, such as <tt>authorized = 1</tt>. Record creations from the association are scoped if a hash is used.
Expand Down
13 changes: 9 additions & 4 deletions activesupport/lib/active_support/core_ext/try.rb
@@ -1,6 +1,9 @@
class Object
# Tries to send the method only if object responds to it. Return +nil+ otherwise.
# It will also forward any arguments and/or block like Object#send does.
# Invokes the method identified by the symbol +method+, passing it any arguments
# and/or the block specified, just like the regular Ruby <tt>Object#send</tt> does.
#
# *Unlike* that method however, a +NoMethodError+ exception will *not* be raised
# and +nil+ will be returned instead, if the receiving object is a +nil+ object or NilClass.
#
# ==== Examples
#
Expand All @@ -12,11 +15,13 @@ class Object
# With try
# @person.try(:name)
#
# Try also accepts arguments/blocks for the method it is trying
# +try+ also accepts arguments and/or a block, for the method it is trying
# Person.try(:find, 1)
# @people.try(:collect) {|p| p.name}
#--
# This method def is for rdoc only. The alias_method below overrides it as an optimization.
# This method definition below is for rdoc purposes only. The alias_method call
# below overrides it as an optimization since +try+ behaves like +Object#send+,
# unless called on +NilClass+.
def try(method, *args, &block)
send(method, *args, &block)
end
Expand Down
4 changes: 2 additions & 2 deletions railties/Rakefile
Expand Up @@ -285,7 +285,7 @@ task :guides do
asciidoc_conf = 'doc/guides/asciidoc.conf'

ignore = ['..', 'icons', 'images', 'templates', 'stylesheets']
ignore << 'active_record_basics.txt'
#ignore << 'active_record_basics.txt'

indexless = ['index.txt', 'authors.txt']

Expand All @@ -301,7 +301,7 @@ task :guides do
end

entries.each do |entry|
next if ignore.include?(entry)
next if ignore.include?(entry) or entry =~ /^\./ # because Vim is always saving hidden swap files

if File.directory?(File.join(source, entry))
# If the current entry is a directory, then we will want to compile
Expand Down
5 changes: 5 additions & 0 deletions railties/doc/guides/html/2_2_release_notes.html
Expand Up @@ -993,6 +993,11 @@ <h2 id="_deprecated">11. Deprecated</h2>
Durations of fractional months or fractional years are deprecated. Use Ruby&#8217;s core <tt>Date</tt> and <tt>Time</tt> class arithmetic instead.
</p>
</li>
<li>
<p>
<tt>Request#relative_url_root</tt> is deprecated. Use <tt>ActionController::Base.relative_url_root</tt> instead.
</p>
</li>
</ul></div>
</div>
<h2 id="_credits">12. Credits</h2>
Expand Down

0 comments on commit 886124e

Please sign in to comment.