aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/attributes_test.rb (renamed from activerecord/test/cases/custom_properties_test.rb)14
-rw-r--r--activerecord/test/cases/base_test.rb6
-rw-r--r--activerecord/test/cases/calculations_test.rb6
-rw-r--r--activerecord/test/cases/dirty_test.rb2
-rw-r--r--activerecord/test/cases/migration_test.rb6
5 files changed, 17 insertions, 17 deletions
diff --git a/activerecord/test/cases/custom_properties_test.rb b/activerecord/test/cases/attributes_test.rb
index 9ba1e83df6..79ef0502cb 100644
--- a/activerecord/test/cases/custom_properties_test.rb
+++ b/activerecord/test/cases/attributes_test.rb
@@ -1,17 +1,17 @@
require 'cases/helper'
class OverloadedType < ActiveRecord::Base
- property :overloaded_float, Type::Integer.new
- property :overloaded_string_with_limit, Type::String.new(limit: 50)
- property :non_existent_decimal, Type::Decimal.new
- property :string_with_default, Type::String.new, default: 'the overloaded default'
+ attribute :overloaded_float, Type::Integer.new
+ attribute :overloaded_string_with_limit, Type::String.new(limit: 50)
+ attribute :non_existent_decimal, Type::Decimal.new
+ attribute :string_with_default, Type::String.new, default: 'the overloaded default'
end
class ChildOfOverloadedType < OverloadedType
end
class GrandchildOfOverloadedType < ChildOfOverloadedType
- property :overloaded_float, Type::Float.new
+ attribute :overloaded_float, Type::Float.new
end
class UnoverloadedType < ActiveRecord::Base
@@ -54,7 +54,7 @@ module ActiveRecord
assert_equal 255, UnoverloadedType.columns_hash['overloaded_string_with_limit'].limit
end
- def test_nonexistent_property
+ def test_nonexistent_attribute
data = OverloadedType.new(non_existent_decimal: 1)
assert_equal BigDecimal.new(1), data.non_existent_decimal
@@ -98,7 +98,7 @@ module ActiveRecord
assert_not klass.column_names.include?('wibble')
assert_equal 5, klass.content_columns.length
- klass.property :wibble, Type::Value.new
+ klass.attribute :wibble, Type::Value.new
assert_equal 7, klass.columns.length
assert klass.columns_hash.key?('wibble')
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb
index f01901514e..fad51f4924 100644
--- a/activerecord/test/cases/base_test.rb
+++ b/activerecord/test/cases/base_test.rb
@@ -985,9 +985,9 @@ class BasicsTest < ActiveRecord::TestCase
class NumericData < ActiveRecord::Base
self.table_name = 'numeric_data'
- property :world_population, Type::Integer.new
- property :my_house_population, Type::Integer.new
- property :atoms_in_universe, Type::Integer.new
+ attribute :world_population, Type::Integer.new
+ attribute :my_house_population, Type::Integer.new
+ attribute :atoms_in_universe, Type::Integer.new
end
def test_big_decimal_conditions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb
index b9445ee072..dfc6a7ec67 100644
--- a/activerecord/test/cases/calculations_test.rb
+++ b/activerecord/test/cases/calculations_test.rb
@@ -16,9 +16,9 @@ Company.has_many :accounts
class NumericData < ActiveRecord::Base
self.table_name = 'numeric_data'
- property :world_population, Type::Integer.new
- property :my_house_population, Type::Integer.new
- property :atoms_in_universe, Type::Integer.new
+ attribute :world_population, Type::Integer.new
+ attribute :my_house_population, Type::Integer.new
+ attribute :atoms_in_universe, Type::Integer.new
end
class CalculationsTest < ActiveRecord::TestCase
diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb
index 987c55ebc2..2beac84fb1 100644
--- a/activerecord/test/cases/dirty_test.rb
+++ b/activerecord/test/cases/dirty_test.rb
@@ -631,7 +631,7 @@ class DirtyTest < ActiveRecord::TestCase
model_class = Class.new(ActiveRecord::Base) do
self.table_name = 'numeric_data'
- property :foo, type.new, default: 1
+ attribute :foo, type.new, default: 1
end
model = model_class.new
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index 5b4531846d..9855835e27 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -13,10 +13,10 @@ require MIGRATIONS_ROOT + "/decimal/1_give_me_big_numbers"
class BigNumber < ActiveRecord::Base
unless current_adapter?(:PostgreSQLAdapter, :SQLite3Adapter)
- property :value_of_e, Type::Integer.new
+ attribute :value_of_e, Type::Integer.new
end
- property :world_population, Type::Integer.new
- property :my_house_population, Type::Integer.new
+ attribute :world_population, Type::Integer.new
+ attribute :my_house_population, Type::Integer.new
end
class Reminder < ActiveRecord::Base; end