aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/querying.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2018-02-14 16:51:15 -0800
committerGitHub <noreply@github.com>2018-02-14 16:51:15 -0800
commitfe6adf43e124f4c9132e5a88a80ebba3f10fd2cb (patch)
tree9b038131edd2aa8735e7996a9646f927a354f0c2 /activerecord/lib/active_record/querying.rb
parentfbc7d63ab46a50bb716dd96059fc4e898b0b865f (diff)
downloadrails-fe6adf43e124f4c9132e5a88a80ebba3f10fd2cb.tar.gz
rails-fe6adf43e124f4c9132e5a88a80ebba3f10fd2cb.tar.bz2
rails-fe6adf43e124f4c9132e5a88a80ebba3f10fd2cb.zip
Add #create_or_find_by to lean on unique constraints (#31989)
Add #create_or_find_by to lean on unique constraints
Diffstat (limited to 'activerecord/lib/active_record/querying.rb')
-rw-r--r--activerecord/lib/active_record/querying.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/querying.rb b/activerecord/lib/active_record/querying.rb
index 3996d5661f..7c8f794910 100644
--- a/activerecord/lib/active_record/querying.rb
+++ b/activerecord/lib/active_record/querying.rb
@@ -5,7 +5,7 @@ module ActiveRecord
delegate :find, :take, :take!, :first, :first!, :last, :last!, :exists?, :any?, :many?, :none?, :one?, to: :all
delegate :second, :second!, :third, :third!, :fourth, :fourth!, :fifth, :fifth!, :forty_two, :forty_two!, :third_to_last, :third_to_last!, :second_to_last, :second_to_last!, to: :all
delegate :first_or_create, :first_or_create!, :first_or_initialize, to: :all
- delegate :find_or_create_by, :find_or_create_by!, :find_or_initialize_by, to: :all
+ delegate :find_or_create_by, :find_or_create_by!, :create_or_find_by, :create_or_find_by!, :find_or_initialize_by, to: :all
delegate :find_by, :find_by!, to: :all
delegate :destroy_all, :delete_all, :update_all, to: :all
delegate :find_each, :find_in_batches, :in_batches, to: :all