mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Call the new point behavior :point
, not :rails_5_1_point
Since the attributes API is new in Rails 5, we don't actually need to keep the behavior of `attribute :point`, as it's not a breaking change.
This commit is contained in:
parent
0957c8ad67
commit
7f86ed8b36
3 changed files with 6 additions and 7 deletions
|
@ -816,9 +816,8 @@ module ActiveRecord
|
|||
ActiveRecord::Type.register(:json, OID::Json, adapter: :postgresql)
|
||||
ActiveRecord::Type.register(:jsonb, OID::Jsonb, adapter: :postgresql)
|
||||
ActiveRecord::Type.register(:money, OID::Money, adapter: :postgresql)
|
||||
ActiveRecord::Type.register(:point, OID::Point, adapter: :postgresql)
|
||||
ActiveRecord::Type.register(:point, OID::Rails51Point, adapter: :postgresql)
|
||||
ActiveRecord::Type.register(:legacy_point, OID::Point, adapter: :postgresql)
|
||||
ActiveRecord::Type.register(:rails_5_1_point, OID::Rails51Point, adapter: :postgresql)
|
||||
ActiveRecord::Type.register(:uuid, OID::Uuid, adapter: :postgresql)
|
||||
ActiveRecord::Type.register(:vector, OID::Vector, adapter: :postgresql)
|
||||
ActiveRecord::Type.register(:xml, OID::Xml, adapter: :postgresql)
|
||||
|
|
|
@ -385,7 +385,7 @@ module ActiveRecord
|
|||
|
||||
If you'd like the new behavior today, you can add this line:
|
||||
|
||||
attribute :#{column.name}, :rails_5_1_point#{array_arguments}
|
||||
attribute :#{column.name}, :point#{array_arguments}
|
||||
WARNING
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,10 +7,10 @@ class PostgresqlPointTest < ActiveRecord::PostgreSQLTestCase
|
|||
include SchemaDumpingHelper
|
||||
|
||||
class PostgresqlPoint < ActiveRecord::Base
|
||||
attribute :x, :rails_5_1_point
|
||||
attribute :y, :rails_5_1_point
|
||||
attribute :z, :rails_5_1_point
|
||||
attribute :array_of_points, :rails_5_1_point, array: true
|
||||
attribute :x, :point
|
||||
attribute :y, :point
|
||||
attribute :z, :point
|
||||
attribute :array_of_points, :point, array: true
|
||||
attribute :legacy_x, :legacy_point
|
||||
attribute :legacy_y, :legacy_point
|
||||
attribute :legacy_z, :legacy_point
|
||||
|
|
Loading…
Reference in a new issue