aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2012-09-03 20:38:14 +0200
committerYves Senn <yves.senn@gmail.com>2012-09-03 20:38:14 +0200
commit9f494a9a3489cf03b0d6d3c87cb8638c3b867c86 (patch)
tree8ae1fa856de7ed814d02cfd25d5e28cded80daa6 /activerecord
parent77ca2815f5c5fc20a9ca7fa4cdd16d0c4b908682 (diff)
downloadrails-9f494a9a3489cf03b0d6d3c87cb8638c3b867c86.tar.gz
rails-9f494a9a3489cf03b0d6d3c87cb8638c3b867c86.tar.bz2
rails-9f494a9a3489cf03b0d6d3c87cb8638c3b867c86.zip
test cleanup, remove ruby_type because it's no longer needed
All tests with a custom inheritance_column use the `Vegtable` model. The field ruby_type on the Company models is no longer needed
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/attribute_methods_test.rb2
-rw-r--r--activerecord/test/cases/base_test.rb2
-rw-r--r--activerecord/test/cases/inheritance_test.rb2
-rw-r--r--activerecord/test/cases/schema_dumper_test.rb2
-rw-r--r--activerecord/test/fixtures/companies.yml6
-rw-r--r--activerecord/test/models/company.rb4
-rw-r--r--activerecord/test/schema/schema.rb3
7 files changed, 5 insertions, 16 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb
index ea58a624a1..d08b157011 100644
--- a/activerecord/test/cases/attribute_methods_test.rb
+++ b/activerecord/test/cases/attribute_methods_test.rb
@@ -395,7 +395,7 @@ class AttributeMethodsTest < ActiveRecord::TestCase
def test_query_attribute_with_custom_fields
object = Company.find_by_sql(<<-SQL).first
- SELECT c1.*, c2.ruby_type as string_value, c2.rating as int_value
+ SELECT c1.*, c2.type as string_value, c2.rating as int_value
FROM companies c1, companies c2
WHERE c1.firm_id = c2.id
AND c1.id = 2
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb
index c6f7e8cf0f..9fcee99222 100644
--- a/activerecord/test/cases/base_test.rb
+++ b/activerecord/test/cases/base_test.rb
@@ -1735,7 +1735,7 @@ class BasicsTest < ActiveRecord::TestCase
end
def test_attribute_names
- assert_equal ["id", "type", "ruby_type", "firm_id", "firm_name", "name", "client_of", "rating", "account_id", "description"],
+ assert_equal ["id", "type", "firm_id", "firm_name", "name", "client_of", "rating", "account_id", "description"],
Company.attribute_names
end
diff --git a/activerecord/test/cases/inheritance_test.rb b/activerecord/test/cases/inheritance_test.rb
index ca5b24b253..8fded9159f 100644
--- a/activerecord/test/cases/inheritance_test.rb
+++ b/activerecord/test/cases/inheritance_test.rb
@@ -288,7 +288,7 @@ class InheritanceComputeTypeTest < ActiveRecord::TestCase
def test_instantiation_doesnt_try_to_require_corresponding_file
ActiveRecord::Base.store_full_sti_class = false
foo = Firm.first.clone
- foo.ruby_type = foo.type = 'FirmOnTheFly'
+ foo.type = 'FirmOnTheFly'
foo.save!
# Should fail without FirmOnTheFly in the type condition.
diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb
index 01dd25a9df..92084d3eb6 100644
--- a/activerecord/test/cases/schema_dumper_test.rb
+++ b/activerecord/test/cases/schema_dumper_test.rb
@@ -182,7 +182,7 @@ class SchemaDumperTest < ActiveRecord::TestCase
def test_schema_dumps_index_columns_in_right_order
index_definition = standard_dump.split(/\n/).grep(/add_index.*companies/).first.strip
- assert_equal 'add_index "companies", ["firm_id", "type", "rating", "ruby_type"], :name => "company_index"', index_definition
+ assert_equal 'add_index "companies", ["firm_id", "type", "rating"], :name => "company_index"', index_definition
end
def test_schema_dumps_partial_indices
diff --git a/activerecord/test/fixtures/companies.yml b/activerecord/test/fixtures/companies.yml
index a982d3921d..0766e92027 100644
--- a/activerecord/test/fixtures/companies.yml
+++ b/activerecord/test/fixtures/companies.yml
@@ -4,14 +4,12 @@ first_client:
firm_id: 1
client_of: 2
name: Summit
- ruby_type: Client
firm_name: 37signals
first_firm:
id: 1
type: Firm
name: 37signals
- ruby_type: Firm
firm_id: 1
second_client:
@@ -20,13 +18,11 @@ second_client:
firm_id: 1
client_of: 1
name: Microsoft
- ruby_type: Client
another_firm:
id: 4
type: Firm
name: Flamboyant Software
- ruby_type: Firm
another_client:
id: 5
@@ -34,7 +30,6 @@ another_client:
firm_id: 4
client_of: 4
name: Ex Nihilo
- ruby_type: Client
a_third_client:
id: 10
@@ -42,7 +37,6 @@ a_third_client:
firm_id: 4
client_of: 4
name: Ex Nihilo Part Deux
- ruby_type: Client
rails_core:
id: 6
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb
index 75f38d275c..9bdce6e729 100644
--- a/activerecord/test/models/company.rb
+++ b/activerecord/test/models/company.rb
@@ -173,10 +173,6 @@ class Client < Company
before_destroy :overwrite_to_raise
# Used to test that read and question methods are not generated for these attributes
- def ruby_type
- read_attribute :ruby_type
- end
-
def rating?
query_attribute :rating
end
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index 7b37ac3389..007349ea87 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -171,7 +171,6 @@ ActiveRecord::Schema.define do
create_table :companies, :force => true do |t|
t.string :type
- t.string :ruby_type
t.integer :firm_id
t.string :firm_name
t.string :name
@@ -181,7 +180,7 @@ ActiveRecord::Schema.define do
t.string :description, :default => ""
end
- add_index :companies, [:firm_id, :type, :rating, :ruby_type], :name => "company_index"
+ add_index :companies, [:firm_id, :type, :rating], :name => "company_index"
add_index :companies, [:firm_id, :type], :name => "company_partial_index", :where => "rating > 10"
create_table :vegetables, :force => true do |t|