mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
[ci skip] Remove useless "@api public/private"
Other public APIs do not have these annotations.
This commit is contained in:
parent
1ebd987aeb
commit
e0702972b4
1 changed files with 1 additions and 7 deletions
|
@ -66,7 +66,6 @@ module ActiveRecord
|
||||||
#
|
#
|
||||||
# Account.reflections # => {"balance" => AggregateReflection}
|
# Account.reflections # => {"balance" => AggregateReflection}
|
||||||
#
|
#
|
||||||
# @api public
|
|
||||||
def reflections
|
def reflections
|
||||||
@__reflections ||= begin
|
@__reflections ||= begin
|
||||||
ref = {}
|
ref = {}
|
||||||
|
@ -96,7 +95,6 @@ module ActiveRecord
|
||||||
# Account.reflect_on_all_associations # returns an array of all associations
|
# Account.reflect_on_all_associations # returns an array of all associations
|
||||||
# Account.reflect_on_all_associations(:has_many) # returns an array of all has_many associations
|
# Account.reflect_on_all_associations(:has_many) # returns an array of all has_many associations
|
||||||
#
|
#
|
||||||
# @api public
|
|
||||||
def reflect_on_all_associations(macro = nil)
|
def reflect_on_all_associations(macro = nil)
|
||||||
association_reflections = reflections.values
|
association_reflections = reflections.values
|
||||||
association_reflections.select! { |reflection| reflection.macro == macro } if macro
|
association_reflections.select! { |reflection| reflection.macro == macro } if macro
|
||||||
|
@ -108,24 +106,20 @@ module ActiveRecord
|
||||||
# Account.reflect_on_association(:owner) # returns the owner AssociationReflection
|
# Account.reflect_on_association(:owner) # returns the owner AssociationReflection
|
||||||
# Invoice.reflect_on_association(:line_items).macro # returns :has_many
|
# Invoice.reflect_on_association(:line_items).macro # returns :has_many
|
||||||
#
|
#
|
||||||
# @api public
|
|
||||||
def reflect_on_association(association)
|
def reflect_on_association(association)
|
||||||
reflections[association.to_s]
|
reflections[association.to_s]
|
||||||
end
|
end
|
||||||
|
|
||||||
# @api private
|
|
||||||
def _reflect_on_association(association) #:nodoc:
|
def _reflect_on_association(association) #:nodoc:
|
||||||
_reflections[association.to_s]
|
_reflections[association.to_s]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns an array of AssociationReflection objects for all associations which have <tt>:autosave</tt> enabled.
|
# Returns an array of AssociationReflection objects for all associations which have <tt>:autosave</tt> enabled.
|
||||||
#
|
|
||||||
# @api public
|
|
||||||
def reflect_on_all_autosave_associations
|
def reflect_on_all_autosave_associations
|
||||||
reflections.values.select { |reflection| reflection.options[:autosave] }
|
reflections.values.select { |reflection| reflection.options[:autosave] }
|
||||||
end
|
end
|
||||||
|
|
||||||
def clear_reflections_cache #:nodoc:
|
def clear_reflections_cache # :nodoc:
|
||||||
@__reflections = nil
|
@__reflections = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue