| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
For consistency with find_or_initialize_by. Also remove first_or_build
alias.
|
|\
| |
| | |
Add first_or_create family of methods to Active Record
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Active Record.
This let's you write things like:
User.where(:first_name => "Scarlett").first_or_create!(:last_name => "Johansson", :hot => true)
Related to #2420.
|
|/ |
|
|
|
|
| |
supported for mysql2 as well now.
|
|
|
|
| |
by association extensions to access information about the association. This replaces proxy_owner etc with proxy_association.owner.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dynamic finder
The previous behavior was unintentional, and some people was relying on it. Now the dynamic finder will always expecting the number of arguments to be equal or greater (so you can still pass the options to it.)
So if you were doing this and expecting the second argument to be nil:
User.find_by_username_and_group("sikachu")
You'll now get `ArgumentError: wrong number of arguments (1 for 2).` You'll then have to do this:
User.find_by_username_and_group("sikachu", nil)
|
|
|
|
| |
before_initialize callback of the record runs. Fixes #1842.
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 79990505e5080804b53d81fec059136afa2237d7.
Conflicts:
activerecord/CHANGELOG
Reason: Sorry, CHANGELOGs can't be edited via docrails.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This method will also return an empty array on an abstract class or a model that the table doesn't exists.
|
|
|
|
| |
role can be passed in, also updated the Changelog to mention the change to some of the AR method signatures.
|
| |
|
| |
|
| |
|
|
|
|
| |
You can also just use a block.
|
|
|
|
| |
macro multiple times that will give deprecation warnings, and in 3.2 we will simply overwrite the default scope when you call the macro multiple times.
|
|
|
|
|
|
|
|
|
|
| |
the scope class method. Just define a class method yourself instead."
This reverts commit f0e198bfa1e3f9689e0cde1d194a44027fc90b3c.
Conflicts:
activerecord/test/models/post.rb
|
|
|
|
| |
class method. Just define a class method yourself instead.
|
|
|
|
| |
problems with default scopes getting included into other scopes and then being unable to remove the default part via unscoped.
|
|
|
|
| |
favour of defining a 'default_scope' class method in the model. See the CHANGELOG for more details.
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
|\
| |
| |
| |
| | |
Conflicts:
activerecord/CHANGELOG
|
| |
| |
| |
| | |
configuration of the current connection at runtime
|
|\| |
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
activerecord/CHANGELOG
activerecord/lib/active_record/association_preload.rb
activerecord/lib/active_record/associations.rb
activerecord/lib/active_record/associations/class_methods/join_dependency.rb
activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb
activerecord/lib/active_record/associations/has_many_association.rb
activerecord/lib/active_record/associations/has_many_through_association.rb
activerecord/lib/active_record/associations/has_one_association.rb
activerecord/lib/active_record/associations/has_one_through_association.rb
activerecord/lib/active_record/associations/through_association_scope.rb
activerecord/lib/active_record/reflection.rb
activerecord/test/cases/associations/has_many_through_associations_test.rb
activerecord/test/cases/associations/has_one_through_associations_test.rb
activerecord/test/cases/reflection_test.rb
activerecord/test/cases/relations_test.rb
activerecord/test/fixtures/memberships.yml
activerecord/test/models/categorization.rb
activerecord/test/models/category.rb
activerecord/test/models/member.rb
activerecord/test/models/reference.rb
activerecord/test/models/tagging.rb
|
| |
| |
| |
| | |
[#6268 state:resolved]
|
| |
| |
| |
| | |
manages the association, and a CollectionProxy class which is *only* a proxy. Singular associations no longer have a proxy. See CHANGELOG for more.
|
| |
| |
| |
| | |
the join record is automatically saved too. This requires the :inverse_of option to be set on the source association in the join model. See the CHANGELOG for details. [#4329 state:resolved]
|
| |
| |
| |
| | |
... } rather than instance_eval-ing strings
|
| |
| |
| |
| | |
historical and practical reasons, :delete_all is the default deletion strategy employed by association.delete(*records), despite the fact that the default strategy is :nullify for regular has_many. Also, this only works at all if the source reflection is a belongs_to. For other situations, you should directly modify the through association.
|
| |
| |
| |
| | |
records in the join table. This is to make the destroy method more consistent across the different types of associations. For more details see the CHANGELOG entry.
|
| | |
|
| |
| |
| |
| | |
has_one and belongs_to
|
| |
| |
| |
| | |
table. This has been documented as deprecated behaviour since April 2006. Please use has_many :through instead. A deprecation warning will be added to the 3-0-stable branch for the 3.0.4 release.
|
| | |
|
| | |
|
| |
| |
| |
| | |
a replacement
|
| |
| |
| |
| | |
that up to the programmer
|
| |
| |
| |
| | |
with new compiled gem)
|
| |
| |
| |
| | |
ActiveModel::SecurePassword) to encapsulate dead-simple password usage with SHA2 encryption and salting
|
| | |
|