From a0f5e0b6d9de6594e5a83a4d8eaf7ee9ec1754c9 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Tue, 3 Feb 2009 22:52:07 +0000 Subject: Merge docrails --- railties/doc/guides/html/association_basics.html | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'railties/doc/guides/html/association_basics.html') diff --git a/railties/doc/guides/html/association_basics.html b/railties/doc/guides/html/association_basics.html index bfe8f3f341..0aaad5b5bd 100644 --- a/railties/doc/guides/html/association_basics.html +++ b/railties/doc/guides/html/association_basics.html @@ -791,6 +791,11 @@ http://www.gnu.org/software/src-highlite -->
+
:autosave
+

If you set the :autosave option to true, Rails will save any loaded members and destroy members that are marked for destruction whenever you save the parent object.

:class_name

If the name of the other model cannot be derived from the association name, you can use the :class_name option to supply the model name. For example, if an order belongs to a customer, but the actual name of the model containing customers is Patron, you’d set things up this way:

@@ -1099,6 +1106,11 @@ http://www.gnu.org/software/src-highlite -->
  • +:autosave +

    +
  • +
  • +

    :class_name

  • @@ -1165,6 +1177,8 @@ http://www.gnu.org/software/src-highlite -->
    :as

    Setting the :as option indicates that this is a polymorphic association. Polymorphic associations are discussed in detail later in this guide.

    +
    :autosave
    +

    If you set the :autosave option to true, Rails will save any loaded members and destroy members that are marked for destruction whenever you save the parent object.

    :class_name

    If the name of the other model cannot be derived from the association name, you can use the :class_name option to supply the model name. For example, if a supplier has an account, but the actual name of the model containing accounts is Billing, you’d set things up this way:

    @@ -1467,6 +1481,11 @@ http://www.gnu.org/software/src-highlite -->
  • +:autosave +

    +
  • +
  • +

    :class_name

  • @@ -1568,6 +1587,8 @@ http://www.gnu.org/software/src-highlite -->
    :as

    Setting the :as option indicates that this is a polymorphic association, as discussed earlier in this guide.

    +
    :autosave
    +

    If you set the :autosave option to true, Rails will save any loaded members and destroy members that are marked for destruction whenever you save the parent object.

    :class_name

    If the name of the other model cannot be derived from the association name, you can use the :class_name option to supply the model name. For example, if a customer has many orders, but the actual name of the model containing orders is Transaction, you’d set things up this way:

    @@ -1953,6 +1974,11 @@ http://www.gnu.org/software/src-highlite -->
  • +:autosave +

    +
  • +
  • +

    :class_name

  • @@ -2061,6 +2087,8 @@ http://www.gnu.org/software/src-highlite --> has_and_belongs_to_many :friends, :class_name => "User", :foreign_key => "this_user_id", :association_foreign_key => "other_user_id" end
    +
    :autosave
    +

    If you set the :autosave option to true, Rails will save any loaded members and destroy members that are marked for destruction whenever you save the parent object.

    :class_name

    If the name of the other model cannot be derived from the association name, you can use the :class_name option to supply the model name. For example, if a part has many assemblies, but the actual name of the model containing assemblies is Gadget, you’d set things up this way:

    @@ -2293,6 +2321,11 @@ http://www.gnu.org/software/src-highlite -->
    • +February 1, 2009: Added :autosave option Mike Gunderloy +

      +
    • +
    • +

      September 28, 2008: Corrected has_many :through diagram, added polymorphic diagram, some reorganization by Mike Gunderloy . First release version.

    • -- cgit v1.2.3