提交 bef16522 编写于 作者: V Vijay Dev

Merge branch 'master' of github.com:rails/docrails

...@@ -124,8 +124,19 @@ def clear_reflections_cache # :nodoc: ...@@ -124,8 +124,19 @@ def clear_reflections_cache # :nodoc:
end end
end end
# Holds all the methods that are shared between MacroReflection, AssociationReflection # Holds all the methods that are shared between MacroReflection and ThroughReflection.
# and ThroughReflection #
# AbstractReflection
# MacroReflection
# AggregateReflection
# AssociationReflection
# HasManyReflection
# HasOneReflection
# BelongsToReflection
# HasAndBelongsToManyReflection
# ThroughReflection
# PolymorphicReflection
# RuntimeReflection
class AbstractReflection # :nodoc: class AbstractReflection # :nodoc:
def table_name def table_name
klass.table_name klass.table_name
...@@ -232,14 +243,6 @@ def alias_candidate(name) ...@@ -232,14 +243,6 @@ def alias_candidate(name)
# Base class for AggregateReflection and AssociationReflection. Objects of # Base class for AggregateReflection and AssociationReflection. Objects of
# AggregateReflection and AssociationReflection are returned by the Reflection::ClassMethods. # AggregateReflection and AssociationReflection are returned by the Reflection::ClassMethods.
#
# MacroReflection
# AggregateReflection
# AssociationReflection
# HasManyReflection
# HasOneReflection
# BelongsToReflection
# ThroughReflection
class MacroReflection < AbstractReflection class MacroReflection < AbstractReflection
# Returns the name of the macro. # Returns the name of the macro.
# #
......
...@@ -192,8 +192,6 @@ def test_add_table_with_decimals ...@@ -192,8 +192,6 @@ def test_add_table_with_decimals
# of 0, they take on the compile-time limit for precision and scale, # of 0, they take on the compile-time limit for precision and scale,
# so the following should succeed unless you have used really wacky # so the following should succeed unless you have used really wacky
# compilation options # compilation options
# - SQLite2 has the default behavior of preserving all data sent in,
# so this happens there too
assert_kind_of BigDecimal, b.value_of_e assert_kind_of BigDecimal, b.value_of_e
assert_equal BigDecimal("2.7182818284590452353602875"), b.value_of_e assert_equal BigDecimal("2.7182818284590452353602875"), b.value_of_e
elsif current_adapter?(:SQLite3Adapter) elsif current_adapter?(:SQLite3Adapter)
......
...@@ -80,7 +80,7 @@ def warn(callstack, called, args) ...@@ -80,7 +80,7 @@ def warn(callstack, called, args)
# example.old_request.to_s # example.old_request.to_s
# # => DEPRECATION WARNING: @request is deprecated! Call request.to_s instead of # # => DEPRECATION WARNING: @request is deprecated! Call request.to_s instead of
# @request.to_s # @request.to_s
# (Bactrace information…) # (Backtrace information…)
# "special_request" # "special_request"
# #
# example.request.to_s # example.request.to_s
...@@ -118,7 +118,7 @@ def warn(callstack, called, args) ...@@ -118,7 +118,7 @@ def warn(callstack, called, args)
# #
# PLANETS.map { |planet| planet.capitalize } # PLANETS.map { |planet| planet.capitalize }
# # => DEPRECATION WARNING: PLANETS is deprecated! Use PLANETS_POST_2006 instead. # # => DEPRECATION WARNING: PLANETS is deprecated! Use PLANETS_POST_2006 instead.
# (Bactrace information…) # (Backtrace information…)
# ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"] # ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"]
class DeprecatedConstantProxy < DeprecationProxy class DeprecatedConstantProxy < DeprecationProxy
def initialize(old_const, new_const, deprecator = ActiveSupport::Deprecation.instance) def initialize(old_const, new_const, deprecator = ActiveSupport::Deprecation.instance)
......
...@@ -726,7 +726,7 @@ class Author < ApplicationRecord ...@@ -726,7 +726,7 @@ class Author < ApplicationRecord
has_many :books, inverse_of: :author has_many :books, inverse_of: :author
end end
class book < ApplicationRecord class Book < ApplicationRecord
belongs_to :author, inverse_of: :books belongs_to :author, inverse_of: :books
end end
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册