0
@@ -73,6 +73,7 @@ module ActiveRecord
0
+ # See ActiveRecord::Associations::ClassMethods for documentation.
0
module Associations # :nodoc:
0
def self.included(base)
0
base.extend(ClassMethods)
0
@@ -639,19 +640,19 @@ module ActiveRecord
0
# Returns the number of associated objects.
0
# [collection.find(...)]
0
- # Finds an associated object according to the same rules as
Base.find.
0
+ # Finds an associated object according to the same rules as
ActiveRecord::Base.find.
0
# [collection.exist?(...)]
0
# Checks whether an associated object with the given conditions exists.
0
- # Uses the same rules as
Base.exists?.
0
+ # Uses the same rules as
ActiveRecord::Base.exists?.
0
# [collection.build(attributes = {}, ...)]
0
# Returns one or more new objects of the collection type that have been instantiated
0
# with +attributes+ and linked to this object through a foreign key, but have not yet
0
- # been saved.
*Note:* This only works if an associated object already exists, not if
0
+ # been saved.
<b>Note:</b> This only works if an associated object already exists, not if
0
# [collection.create(attributes = {})]
0
# Returns a new object of the collection type that has been instantiated
0
# with +attributes+, linked to this object through a foreign key, and that has already
0
- # been saved (if it passed the validation).
*Note:* This only works if an associated
0
+ # been saved (if it passed the validation).
<b>Note:</b> This only works if an associated
0
# object already exists, not if it's +nil+!
0
# (*Note*: +collection+ is replaced with the symbol passed as the first argument, so
0
@@ -769,57 +770,89 @@ module ActiveRecord
0
- # Adds the following methods for retrieval and query of a single associated object:
0
- # +association+ is replaced with the symbol passed as the first argument, so
0
- # <tt>has_one :manager</tt> would add among others <tt>manager.nil?</tt>.
0
- # * <tt>association(force_reload = false)</tt> - Returns the associated object. +nil+ is returned if none is found.
0
- # * <tt>association=(associate)</tt> - Assigns the associate object, extracts the primary key, sets it as the foreign key,
0
+ # Specifies a one-to-one association with another class. This method should only be used
0
+ # if the other class contains the foreign key. If the current class contains the foreign key,
0
+ # then you should use +belongs_to+ instead. See also ActiveRecord::Associations::ClassMethods's overview
0
+ # on when to use has_one and when to use belongs_to.
0
+ # The following methods for retrieval and query of a single associated object will be added:
0
+ # [association(force_reload = false)]
0
+ # Returns the associated object. +nil+ is returned if none is found.
0
+ # [association=(associate)]
0
+ # Assigns the associate object, extracts the primary key, sets it as the foreign key,
0
# and saves the associate object.
0
- # * <tt>association.nil?</tt> - Returns +true+ if there is no associated object.
0
- # * <tt>build_association(attributes = {})</tt> - Returns a new object of the associated type that has been instantiated
0
- # with +attributes+ and linked to this object through a foreign key, but has not yet been saved. Note: This ONLY works if
0
- # an association already exists. It will NOT work if the association is +nil+.
0
- # * <tt>create_association(attributes = {})</tt> - Returns a new object of the associated type that has been instantiated
0
- # with +attributes+, linked to this object through a foreign key, and that has already been saved (if it passed the validation).
0
+ # Returns +true+ if there is no associated object.
0
+ # [build_association(attributes = {})]
0
+ # Returns a new object of the associated type that has been instantiated
0
+ # with +attributes+ and linked to this object through a foreign key, but has not
0
+ # yet been saved. <b>Note:</b> This ONLY works if an association already exists.
0
+ # It will NOT work if the association is +nil+.
0
+ # [create_association(attributes = {})]
0
+ # Returns a new object of the associated type that has been instantiated
0
+ # with +attributes+, linked to this object through a foreign key, and that
0
+ # has already been saved (if it passed the validation).
0
+ # (+association+ is replaced with the symbol passed as the first argument, so
0
+ # <tt>has_one :manager</tt> would add among others <tt>manager.nil?</tt>.)
0
- # Example: An Account class declares <tt>has_one :beneficiary</tt>, which will add:
0
+ # An Account class declares <tt>has_one :beneficiary</tt>, which will add:
0
# * <tt>Account#beneficiary</tt> (similar to <tt>Beneficiary.find(:first, :conditions => "account_id = #{id}")</tt>)
0
# * <tt>Account#beneficiary=(beneficiary)</tt> (similar to <tt>beneficiary.account_id = account.id; beneficiary.save</tt>)
0
# * <tt>Account#beneficiary.nil?</tt>
0
# * <tt>Account#build_beneficiary</tt> (similar to <tt>Beneficiary.new("account_id" => id)</tt>)
0
# * <tt>Account#create_beneficiary</tt> (similar to <tt>b = Beneficiary.new("account_id" => id); b.save; b</tt>)
0
# The declaration can also include an options hash to specialize the behavior of the association.
0
- # * <tt>:class_name</tt> - Specify the class name of the association. Use it only if that name can't be inferred
0
+ # Specify the class name of the association. Use it only if that name can't be inferred
0
# from the association name. So <tt>has_one :manager</tt> will by default be linked to the Manager class, but
0
# if the real class name is Person, you'll have to specify it with this option.
0
- # * <tt>:conditions</tt> - Specify the conditions that the associated object must meet in order to be included as a +WHERE+
0
+ # Specify the conditions that the associated object must meet in order to be included as a +WHERE+
0
# SQL fragment, such as <tt>rank = 5</tt>.
0
- # * <tt>:order</tt> - Specify the order in which the associated objects are returned as an <tt>ORDER BY</tt> SQL fragment,
0
+ # Specify the order in which the associated objects are returned as an <tt>ORDER BY</tt> SQL fragment,
0
# such as <tt>last_name, first_name DESC</tt>.
0
- # * <tt>:dependent</tt> - If set to <tt>:destroy</tt>, the associated object is destroyed when this object is. If set to
0
+ # If set to <tt>:destroy</tt>, the associated object is destroyed when this object is. If set to
0
# <tt>:delete</tt>, the associated object is deleted *without* calling its destroy method. If set to <tt>:nullify</tt>, the associated
0
# object's foreign key is set to +NULL+. Also, association is assigned.
0
- # * <tt>:foreign_key</tt> - Specify the foreign key used for the association. By default this is guessed to be the name
0
+ # Specify the foreign key used for the association. By default this is guessed to be the name
0
# of this class in lower-case and "_id" suffixed. So a Person class that makes a +has_one+ association will use "person_id"
0
# as the default <tt>:foreign_key</tt>.
0
- # * <tt>:primary_key</tt> - Specify the method that returns the primary key used for the association. By default this is +id+.
0
- # * <tt>:include</tt> - Specify second-order associations that should be eager loaded when this object is loaded.
0
- # * <tt>:as</tt> - Specifies a polymorphic interface (See <tt>belongs_to</tt>).
0
- # * <tt>:select</tt> - By default, this is <tt>*</tt> as in <tt>SELECT * FROM</tt>, but can be changed if, for example, you want to do a join
0
+ # Specify the method that returns the primary key used for the association. By default this is +id+.
0
+ # Specify second-order associations that should be eager loaded when this object is loaded.
0
+ # Specifies a polymorphic interface (See <tt>belongs_to</tt>).
0
+ # By default, this is <tt>*</tt> as in <tt>SELECT * FROM</tt>, but can be changed if, for example, you want to do a join
0
# but not include the joined columns. Do not forget to include the primary and foreign keys, otherwise it will raise an error.
0
- # * <tt>:through</tt>: Specifies a Join Model through which to perform the query. Options for <tt>:class_name</tt> and <tt>:foreign_key</tt>
0
+ # Specifies a Join Model through which to perform the query. Options for <tt>:class_name</tt> and <tt>:foreign_key</tt>
0
# are ignored, as the association uses the source reflection. You can only use a <tt>:through</tt> query through a
0
# <tt>has_one</tt> or <tt>belongs_to</tt> association on the join model.
0
- # * <tt>:source</tt> - Specifies the source association name used by <tt>has_one :through</tt> queries. Only use it if the name cannot be
0
+ # Specifies the source association name used by <tt>has_one :through</tt> queries. Only use it if the name cannot be
0
# inferred from the association. <tt>has_one :favorite, :through => :favorites</tt> will look for a
0
# <tt>:favorite</tt> on Favorite, unless a <tt>:source</tt> is given.
0
- # * <tt>:source_type</tt> - Specifies type of the source association used by <tt>has_one :through</tt> queries where the source
0
+ # Specifies type of the source association used by <tt>has_one :through</tt> queries where the source
0
# association is a polymorphic +belongs_to+.
0
- # * <tt>:readonly</tt> - If true, the associated object is readonly through the association.
0
- # * <tt>:validate</tt> - If false, don't validate the associated object when saving the parent object. +false+ by default.
0
+ # If true, the associated object is readonly through the association.
0
+ # If false, don't validate the associated object when saving the parent object. +false+ by default.
0
# has_one :credit_card, :dependent => :destroy # destroys the associated credit card
0
@@ -859,18 +892,34 @@ module ActiveRecord
0
- # Adds the following methods for retrieval and query for a single associated object for which this object holds an id:
0
- # +association+ is replaced with the symbol passed as the first argument, so
0
- # <tt>belongs_to :author</tt> would add among others <tt>author.nil?</tt>.
0
- # * <tt>association(force_reload = false)</tt> - Returns the associated object. +nil+ is returned if none is found.
0
- # * <tt>association=(associate)</tt> - Assigns the associate object, extracts the primary key, and sets it as the foreign key.
0
- # * <tt>association.nil?</tt> - Returns +true+ if there is no associated object.
0
- # * <tt>build_association(attributes = {})</tt> - Returns a new object of the associated type that has been instantiated
0
+ # Specifies a one-to-one association with another class. This method should only be used
0
+ # if this class contains the foreign key. If the other class contains the foreign key,
0
+ # then you should use +has_one+ instead. See also ActiveRecord::Associations::ClassMethods's overview
0
+ # on when to use +has_one+ and when to use +belongs_to+.
0
+ # Methods will be added for retrieval and query for a single associated object, for which
0
+ # this object holds an id:
0
+ # [association(force_reload = false)]
0
+ # Returns the associated object. +nil+ is returned if none is found.
0
+ # [association=(associate)]
0
+ # Assigns the associate object, extracts the primary key, and sets it as the foreign key.
0
+ # Returns +true+ if there is no associated object.
0
+ # [build_association(attributes = {})]
0
+ # Returns a new object of the associated type that has been instantiated
0
# with +attributes+ and linked to this object through a foreign key, but has not yet been saved.
0
- # * <tt>create_association(attributes = {})</tt> - Returns a new object of the associated type that has been instantiated
0
- # with +attributes+, linked to this object through a foreign key, and that has already been saved (if it passed the validation).
0
+ # [create_association(attributes = {})]
0
+ # Returns a new object of the associated type that has been instantiated
0
+ # with +attributes+, linked to this object through a foreign key, and that
0
+ # has already been saved (if it passed the validation).
0
- # Example: A Post class declares <tt>belongs_to :author</tt>, which will add:
0
+ # (+association+ is replaced with the symbol passed as the first argument, so
0
+ # <tt>belongs_to :author</tt> would add among others <tt>author.nil?</tt>.)
0
+ # A Post class declares <tt>belongs_to :author</tt>, which will add:
0
# * <tt>Post#author</tt> (similar to <tt>Author.find(author_id)</tt>)
0
# * <tt>Post#author=(author)</tt> (similar to <tt>post.author_id = author.id</tt>)
0
# * <tt>Post#author?</tt> (similar to <tt>post.author == some_author</tt>)
0
@@ -879,23 +928,30 @@ module ActiveRecord
0
# * <tt>Post#create_author</tt> (similar to <tt>post.author = Author.new; post.author.save; post.author</tt>)
0
# The declaration can also include an options hash to specialize the behavior of the association.
0
- # * <tt>:class_name</tt> - Specify the class name of the association. Use it only if that name can't be inferred
0
+ # Specify the class name of the association. Use it only if that name can't be inferred
0
# from the association name. So <tt>has_one :author</tt> will by default be linked to the Author class, but
0
# if the real class name is Person, you'll have to specify it with this option.
0
- # * <tt>:conditions</tt> - Specify the conditions that the associated object must meet in order to be included as a +WHERE+
0
+ # Specify the conditions that the associated object must meet in order to be included as a +WHERE+
0
# SQL fragment, such as <tt>authorized = 1</tt>.
0
- # * <tt>:select</tt> - By default, this is <tt>*</tt> as in <tt>SELECT * FROM</tt>, but can be changed if, for example, you want to do a join
0
+ # By default, this is <tt>*</tt> as in <tt>SELECT * FROM</tt>, but can be changed if, for example, you want to do a join
0
# but not include the joined columns. Do not forget to include the primary and foreign keys, otherwise it will raise an error.
0
- # * <tt>:foreign_key</tt> - Specify the foreign key used for the association. By default this is guessed to be the name
0
+ # Specify the foreign key used for the association. By default this is guessed to be the name
0
# of the association with an "_id" suffix. So a class that defines a <tt>belongs_to :person</tt> association will use
0
# "person_id" as the default <tt>:foreign_key</tt>. Similarly, <tt>belongs_to :favorite_person, :class_name => "Person"</tt>
0
# will use a foreign key of "favorite_person_id".
0
- # * <tt>:dependent</tt> - If set to <tt>:destroy</tt>, the associated object is destroyed when this object is. If set to
0
+ # If set to <tt>:destroy</tt>, the associated object is destroyed when this object is. If set to
0
# <tt>:delete</tt>, the associated object is deleted *without* calling its destroy method. This option should not be specified when
0
# <tt>belongs_to</tt> is used in conjunction with a <tt>has_many</tt> relationship on another class because of the potential to leave
0
# orphaned records behind.
0
- # * <tt>:counter_cache</tt> - Caches the number of belonging objects on the associate class through the use of +increment_counter+
0
+ # Caches the number of belonging objects on the associate class through the use of +increment_counter+
0
# and +decrement_counter+. The counter cache is incremented when an object of this class is created and decremented when it's
0
# destroyed. This requires that a column named <tt>#{table_name}_count</tt> (such as +comments_count+ for a belonging Comment class)
0
# is used on the associate class (such as a Post class). You can also specify a custom counter cache column by providing
0
@@ -903,12 +959,16 @@ module ActiveRecord
0
# When creating a counter cache column, the database statement or migration must specify a default value of <tt>0</tt>, failing to do
0
# this results in a counter with +NULL+ value, which will never increment.
0
# Note: Specifying a counter cache will add it to that model's list of readonly attributes using +attr_readonly+.
0
- # * <tt>:include</tt> - Specify second-order associations that should be eager loaded when this object is loaded.
0
- # * <tt>:polymorphic</tt> - Specify this association is a polymorphic association by passing +true+.
0
+ # Specify second-order associations that should be eager loaded when this object is loaded.
0
+ # Specify this association is a polymorphic association by passing +true+.
0
# Note: If you've enabled the counter cache, then you may want to add the counter cache attribute
0
# to the +attr_readonly+ list in the associated classes (e.g. <tt>class Post; attr_readonly :comments_count; end</tt>).
0
- # * <tt>:readonly</tt> - If true, the associated object is readonly through the association.
0
- # * <tt>:validate</tt> - If false, don't validate the associated objects when saving the parent object. +false+ by default.
0
+ # If true, the associated object is readonly through the association.
0
+ # If false, don't validate the associated objects when saving the parent object. +false+ by default.
0
# belongs_to :firm, :foreign_key => "client_of"
0
@@ -994,8 +1054,9 @@ module ActiveRecord
0
configure_dependency_for_belongs_to(reflection)
0
- # Associates two classes via an intermediate join table. Unless the join table is explicitly specified as
0
- # an option, it is guessed using the lexical order of the class names. So a join between Developer and Project
0
+ # Specifies a many-to-many relationship with another class. This associates two classes via an
0
+ # intermediate join table. Unless the join table is explicitly specified as an option, it is
0
+ # guessed using the lexical order of the class names. So a join between Developer and Project
0
# will give the default join table name of "developers_projects" because "D" outranks "P". Note that this precedence
0
# is calculated using the <tt><</tt> operator for String. This means that if the strings are of different lengths,
0
# and the strings are equal when compared up to the shortest length, then the longer string is considered of higher
0
@@ -1010,28 +1071,48 @@ module ActiveRecord
0
# associations with attributes to a real join model (see introduction).
0
# Adds the following methods for retrieval and query:
0
- # +collection+ is replaced with the symbol passed as the first argument, so
0
- # <tt>has_and_belongs_to_many :categories</tt> would add among others <tt>categories.empty?</tt>.
0
- # * <tt>collection(force_reload = false)</tt> - Returns an array of all the associated objects.
0
+ # [collection(force_reload = false)]
0
+ # Returns an array of all the associated objects.
0
# An empty array is returned if none are found.
0
- # * <tt>collection<<(object, ...)</tt> - Adds one or more objects to the collection by creating associations in the join table
0
+ # [collection<<(object, ...)]
0
+ # Adds one or more objects to the collection by creating associations in the join table
0
# (<tt>collection.push</tt> and <tt>collection.concat</tt> are aliases to this method).
0
- # * <tt>collection.delete(object, ...)</tt> - Removes one or more objects from the collection by removing their associations from the join table.
0
+ # [collection.delete(object, ...)]
0
+ # Removes one or more objects from the collection by removing their associations from the join table.
0
# This does not destroy the objects.
0
- # * <tt>collection=objects</tt> - Replaces the collection's content by deleting and adding objects as appropriate.
0
- # * <tt>collection_singular_ids</tt> - Returns an array of the associated objects' ids.
0
- # * <tt>collection_singular_ids=ids</tt> - Replace the collection by the objects identified by the primary keys in +ids+.
0
- # * <tt>collection.clear</tt> - Removes every object from the collection. This does not destroy the objects.
0
- # * <tt>collection.empty?</tt> - Returns +true+ if there are no associated objects.
0
- # * <tt>collection.size</tt> - Returns the number of associated objects.
0
- # * <tt>collection.find(id)</tt> - Finds an associated object responding to the +id+ and that
0
+ # [collection=objects]
0
+ # Replaces the collection's content by deleting and adding objects as appropriate.
0
+ # [collection_singular_ids]
0
+ # Returns an array of the associated objects' ids.
0
+ # [collection_singular_ids=ids]
0
+ # Replace the collection by the objects identified by the primary keys in +ids+.
0
+ # Removes every object from the collection. This does not destroy the objects.
0
+ # Returns +true+ if there are no associated objects.
0
+ # Returns the number of associated objects.
0
+ # [collection.find(id)]
0
+ # Finds an associated object responding to the +id+ and that
0
# meets the condition that it has to be associated with this object.
0
- # * <tt>collection.build(attributes = {})</tt> - Returns a new object of the collection type that has been instantiated
0
+ # Uses the same rules as ActiveRecord::Base.find.
0
+ # [collection.exist?(...)]
0
+ # Checks whether an associated object with the given conditions exists.
0
+ # Uses the same rules as ActiveRecord::Base.exists?.
0
+ # [collection.build(attributes = {})]
0
+ # Returns a new object of the collection type that has been instantiated
0
# with +attributes+ and linked to this object through the join table, but has not yet been saved.
0
- # * <tt>collection.create(attributes = {})</tt> - Returns a new object of the collection type that has been instantiated
0
+ # [collection.create(attributes = {})]
0
+ # Returns a new object of the collection type that has been instantiated
0
# with +attributes+, linked to this object through the join table, and that has already been saved (if it passed the validation).
0
- # Example: A Developer class declares <tt>has_and_belongs_to_many :projects</tt>, which will add:
0
+ # (+collection+ is replaced with the symbol passed as the first argument, so
0
+ # <tt>has_and_belongs_to_many :categories</tt> would add among others <tt>categories.empty?</tt>.)
0
+ # A Developer class declares <tt>has_and_belongs_to_many :projects</tt>, which will add:
0
# * <tt>Developer#projects</tt>
0
# * <tt>Developer#projects<<</tt>
0
# * <tt>Developer#projects.delete</tt>
0
@@ -1042,44 +1123,64 @@ module ActiveRecord
0
# * <tt>Developer#projects.empty?</tt>
0
# * <tt>Developer#projects.size</tt>
0
# * <tt>Developer#projects.find(id)</tt>
0
+ # * <tt>Developer#clients.exist?(...)</tt>
0
# * <tt>Developer#projects.build</tt> (similar to <tt>Project.new("project_id" => id)</tt>)
0
# * <tt>Developer#projects.create</tt> (similar to <tt>c = Project.new("project_id" => id); c.save; c</tt>)
0
# The declaration may include an options hash to specialize the behavior of the association.
0
- # * <tt>:class_name</tt> - Specify the class name of the association. Use it only if that name can't be inferred
0
+ # Specify the class name of the association. Use it only if that name can't be inferred
0
# from the association name. So <tt>has_and_belongs_to_many :projects</tt> will by default be linked to the
0
# Project class, but if the real class name is SuperProject, you'll have to specify it with this option.
0
- # * <tt>:join_table</tt> - Specify the name of the join table if the default based on lexical order isn't what you want.
0
- # WARNING: If you're overwriting the table name of either class, the +table_name+ method MUST be declared underneath any
0
- # +has_and_belongs_to_many+ declaration in order to work.
0
- # * <tt>:foreign_key</tt> - Specify the foreign key used for the association. By default this is guessed to be the name
0
+ # Specify the name of the join table if the default based on lexical order isn't what you want.
0
+ # <b>WARNING:</b> If you're overwriting the table name of either class, the +table_name+ method
0
+ # MUST be declared underneath any +has_and_belongs_to_many+ declaration in order to work.
0
+ # Specify the foreign key used for the association. By default this is guessed to be the name
0
# of this class in lower-case and "_id" suffixed. So a Person class that makes a +has_and_belongs_to_many+ association
0
# will use "person_id" as the default <tt>:foreign_key</tt>.
0
- # * <tt>:association_foreign_key</tt> - Specify the association foreign key used for the association. By default this is
0
+ # [:association_foreign_key]
0
+ # Specify the association foreign key used for the association. By default this is
0
# guessed to be the name of the associated class in lower-case and "_id" suffixed. So if the associated class is Project,
0
# the +has_and_belongs_to_many+ association will use "project_id" as the default <tt>:association_foreign_key</tt>.
0
- # * <tt>:conditions</tt> - Specify the conditions that the associated object must meet in order to be included as a +WHERE+
0
+ # Specify the conditions that the associated object must meet in order to be included as a +WHERE+
0
# SQL fragment, such as <tt>authorized = 1</tt>. Record creations from the association are scoped if a hash is used.
0
# <tt>has_many :posts, :conditions => {:published => true}</tt> will create published posts with <tt>@blog.posts.create</tt>
0
# or <tt>@blog.posts.build</tt>.
0
- # * <tt>:order</tt> - Specify the order in which the associated objects are returned as an <tt>ORDER BY</tt> SQL fragment,
0
+ # Specify the order in which the associated objects are returned as an <tt>ORDER BY</tt> SQL fragment,
0
# such as <tt>last_name, first_name DESC</tt>
0
- # * <tt>:uniq</tt> - If true, duplicate associated objects will be ignored by accessors and query methods.
0
- # * <tt>:finder_sql</tt> - Overwrite the default generated SQL statement used to fetch the association with a manual statement
0
- # * <tt>:delete_sql</tt> - Overwrite the default generated SQL statement used to remove links between the associated
0
+ # If true, duplicate associated objects will be ignored by accessors and query methods.
0
+ # Overwrite the default generated SQL statement used to fetch the association with a manual statement
0
+ # Overwrite the default generated SQL statement used to remove links between the associated
0
# classes with a manual statement.
0
- # * <tt>:insert_sql</tt> - Overwrite the default generated SQL statement used to add links between the associated classes
0
+ # Overwrite the default generated SQL statement used to add links between the associated classes
0
# with a manual statement.
0
- # * <tt>:extend</tt> - Anonymous module for extending the proxy, see "Association extensions".
0
- # * <tt>:include</tt> - Specify second-order associations that should be eager loaded when the collection is loaded.
0
- # * <tt>:group</tt> - An attribute name by which the result should be grouped. Uses the <tt>GROUP BY</tt> SQL-clause.
0
- # * <tt>:limit</tt> - An integer determining the limit on the number of rows that should be returned.
0
- # * <tt>:offset</tt> - An integer determining the offset from where the rows should be fetched. So at 5, it would skip the first 4 rows.
0
- # * <tt>:select</tt> - By default, this is <tt>*</tt> as in <tt>SELECT * FROM</tt>, but can be changed if, for example, you want to do a join
0
+ # Anonymous module for extending the proxy, see "Association extensions".
0
+ # Specify second-order associations that should be eager loaded when the collection is loaded.
0
+ # An attribute name by which the result should be grouped. Uses the <tt>GROUP BY</tt> SQL-clause.
0
+ # An integer determining the limit on the number of rows that should be returned.
0
+ # An integer determining the offset from where the rows should be fetched. So at 5, it would skip the first 4 rows.
0
+ # By default, this is <tt>*</tt> as in <tt>SELECT * FROM</tt>, but can be changed if, for example, you want to do a join
0
# but not include the joined columns. Do not forget to include the primary and foreign keys, otherwise it will raise an error.
0
- # * <tt>:readonly</tt> - If true, all the associated objects are readonly through the association.
0
- # * <tt>:validate</tt> - If false, don't validate the associated objects when saving the parent object. +true+ by default.
0
+ # If true, all the associated objects are readonly through the association.
0
+ # If false, don't validate the associated objects when saving the parent object. +true+ by default.
0
# has_and_belongs_to_many :projects
Comments
No one has commented yet.