From f2810f1dab649b2999fa0ad991ddabb416c5be74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20Lo=CC=81pez?= Date: Mon, 7 Aug 2017 16:49:00 -0400 Subject: add reload_association to documentation [ci skip] --- activerecord/lib/active_record/associations.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 840f71bef2..eb1418478c 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -349,6 +349,7 @@ module ActiveRecord # build_other(attributes={}) | X | | X # create_other(attributes={}) | X | | X # create_other!(attributes={}) | X | | X + # reload_other | X | X | X # # === Collection associations (one-to-many / many-to-many) # | | | has_many @@ -378,6 +379,7 @@ module ActiveRecord # others.exists? | X | X | X # others.distinct | X | X | X # others.reset | X | X | X + # others.reload | X | X | X # # === Overriding generated methods # @@ -1426,6 +1428,8 @@ module ActiveRecord # [create_association!(attributes = {})] # Does the same as create_association, but raises ActiveRecord::RecordInvalid # if the record is invalid. + # [reload_association] + # Returns the associated object, forcing a database read. # # === Example # @@ -1435,6 +1439,7 @@ module ActiveRecord # * Account#build_beneficiary (similar to Beneficiary.new("account_id" => id)) # * Account#create_beneficiary (similar to b = Beneficiary.new("account_id" => id); b.save; b) # * Account#create_beneficiary! (similar to b = Beneficiary.new("account_id" => id); b.save!; b) + # * Account#reload_beneficiary # # === Scopes # @@ -1555,6 +1560,8 @@ module ActiveRecord # [create_association!(attributes = {})] # Does the same as create_association, but raises ActiveRecord::RecordInvalid # if the record is invalid. + # [reload_association] + # Returns the associated object, forcing a database read. # # === Example # @@ -1564,6 +1571,7 @@ module ActiveRecord # * Post#build_author (similar to post.author = Author.new) # * Post#create_author (similar to post.author = Author.new; post.author.save; post.author) # * Post#create_author! (similar to post.author = Author.new; post.author.save!; post.author) + # * Post#reload_author # The declaration can also include an +options+ hash to specialize the behavior of the association. # # === Scopes -- cgit v1.2.3