rm unnecessary test

interpolation is no longer a thing separate from "normal" assoc
conditions.
This commit is contained in:
Jon Leighton 2012-07-20 19:35:02 +01:00
parent f7d8aac40a
commit 2f6e33d3f8
3 changed files with 0 additions and 12 deletions

View File

@ -813,13 +813,6 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
assert post[:author_count].nil?
end
def test_interpolated_conditions
post = posts(:welcome)
assert !post.tags.empty?
assert_equal post.tags, post.interpolated_tags
assert_equal post.tags, post.interpolated_tags_2
end
def test_primary_key_option_on_source
post = posts(:welcome)
category = categories(:general)

View File

@ -70,10 +70,6 @@ class Post < ActiveRecord::Base
end
end
has_many :interpolated_taggings, -> { where "1 = #{1}" }, :class_name => 'Tagging', :as => :taggable
has_many :interpolated_tags, :through => :taggings
has_many :interpolated_tags_2, :through => :interpolated_taggings, :source => :tag
has_many :taggings_with_delete_all, :class_name => 'Tagging', :as => :taggable, :dependent => :delete_all
has_many :taggings_with_destroy, :class_name => 'Tagging', :as => :taggable, :dependent => :destroy

View File

@ -8,7 +8,6 @@ class Tagging < ActiveRecord::Base
belongs_to :invalid_tag, :class_name => 'Tag', :foreign_key => 'tag_id'
belongs_to :blue_tag, -> { where :tags => { :name => 'Blue' } }, :class_name => 'Tag', :foreign_key => :tag_id
belongs_to :tag_with_primary_key, :class_name => 'Tag', :foreign_key => :tag_id, :primary_key => :custom_primary_key
belongs_to :interpolated_tag, -> { where "1 = #{1}" }, :class_name => 'Tag', :foreign_key => :tag_id
belongs_to :taggable, :polymorphic => true, :counter_cache => true
has_many :things, :through => :taggable
end