mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
removing unused variables
This commit is contained in:
parent
e83d15376d
commit
4d31ee1e0e
6 changed files with 7 additions and 12 deletions
|
@ -16,7 +16,7 @@ module ActiveRecord
|
|||
:readonly => @reflection.options[:readonly]
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
def construct_create_scope
|
||||
construct_owner_attributes(@reflection)
|
||||
end
|
||||
|
@ -51,7 +51,7 @@ module ActiveRecord
|
|||
|
||||
def construct_select(custom_select = nil)
|
||||
distinct = "DISTINCT " if @reflection.options[:uniq]
|
||||
selected = custom_select || @reflection.options[:select] || "#{distinct}#{@reflection.quoted_table_name}.*"
|
||||
custom_select || @reflection.options[:select] || "#{distinct}#{@reflection.quoted_table_name}.*"
|
||||
end
|
||||
|
||||
def construct_joins(custom_joins = nil)
|
||||
|
|
|
@ -67,8 +67,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
|
|||
end
|
||||
|
||||
def test_no_sql_should_be_fired_if_association_already_loaded
|
||||
car = Car.create(:name => 'honda')
|
||||
bulb = car.bulbs.create
|
||||
Car.create(:name => 'honda')
|
||||
bulbs = Car.first.bulbs
|
||||
bulbs.inspect # to load all instances of bulbs
|
||||
assert_no_queries do
|
||||
|
|
|
@ -354,7 +354,6 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
|
|||
end
|
||||
|
||||
def test_has_many_association_through_a_belongs_to_association_where_the_association_doesnt_exist
|
||||
author = authors(:mary)
|
||||
post = Post.create!(:title => "TITLE", :body => "BODY")
|
||||
assert_equal [], post.author_favorites
|
||||
end
|
||||
|
|
|
@ -163,7 +163,6 @@ class HasOneAssociationsTest < ActiveRecord::TestCase
|
|||
|
||||
firm = ExclusivelyDependentFirm.find(9)
|
||||
assert_not_nil firm.account
|
||||
account_id = firm.account.id
|
||||
assert_equal [], Account.destroyed_account_ids[firm.id]
|
||||
|
||||
firm.destroy
|
||||
|
@ -180,7 +179,7 @@ class HasOneAssociationsTest < ActiveRecord::TestCase
|
|||
def test_dependence_with_restrict
|
||||
firm = RestrictedFirm.new(:name => 'restrict')
|
||||
firm.save!
|
||||
account = firm.create_account(:credit_limit => 10)
|
||||
firm.create_account(:credit_limit => 10)
|
||||
assert_not_nil firm.account
|
||||
assert_raise(ActiveRecord::DeleteRestrictionError) { firm.destroy }
|
||||
end
|
||||
|
@ -197,8 +196,8 @@ class HasOneAssociationsTest < ActiveRecord::TestCase
|
|||
def test_build_association_twice_without_saving_affects_nothing
|
||||
count_of_account = Account.count
|
||||
firm = Firm.find(:first)
|
||||
account1 = firm.build_account("credit_limit" => 1000)
|
||||
account2 = firm.build_account("credit_limit" => 2000)
|
||||
firm.build_account("credit_limit" => 1000)
|
||||
firm.build_account("credit_limit" => 2000)
|
||||
|
||||
assert_equal count_of_account, Account.count
|
||||
end
|
||||
|
|
|
@ -484,7 +484,6 @@ class InversePolymorphicBelongsToTests < ActiveRecord::TestCase
|
|||
|
||||
def test_child_instance_should_be_shared_with_replaced_via_accessor_parent
|
||||
face = faces(:confused)
|
||||
old_man = face.polymorphic_man
|
||||
new_man = Man.new
|
||||
|
||||
assert_not_nil face.polymorphic_man
|
||||
|
@ -499,7 +498,6 @@ class InversePolymorphicBelongsToTests < ActiveRecord::TestCase
|
|||
|
||||
def test_child_instance_should_be_shared_with_replaced_via_method_parent
|
||||
face = faces(:confused)
|
||||
old_man = face.polymorphic_man
|
||||
new_man = Man.new
|
||||
|
||||
assert_not_nil face.polymorphic_man
|
||||
|
|
|
@ -642,7 +642,7 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
|
|||
|
||||
def test_preload_nil_polymorphic_belongs_to
|
||||
assert_nothing_raised do
|
||||
taggings = Tagging.find(:all, :include => :taggable, :conditions => ['taggable_type IS NULL'])
|
||||
Tagging.find(:all, :include => :taggable, :conditions => ['taggable_type IS NULL'])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue