Skip to content

Commit

Permalink
Remove 1.2.6 and 2.0.1 support which used named scope hacks.
Browse files Browse the repository at this point in the history
  • Loading branch information
metaskills committed May 5, 2009
1 parent 6fc2450 commit 85a743e
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 439 deletions.
2 changes: 1 addition & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GroupedScope aims to make two things easier in your ActiveRecord models. First,
easy way to group objects, second, to allow the group to share associated object via existing
has_many relationships. See installation and usage for more details.

By the way, this plugin has been tested with rails 1.2.6, 2.0.4, and 2.1.1.
By the way, this plugin has been tested with rails 2.3.2, 2.2.2, and 2.1.1


=== Installation & Usage
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Rake::TestTask.new(:test) do |t|
t.verbose = true
end

desc 'Test the GroupedScope plugin with Rails 2.1.1, 2.0.4 & 1.2.6 gems'
desc 'Test the GroupedScope plugin with Rails 2.3.2, 2.2.2, and 2.1.1 gems'
task :test_rails do
test = Rake::Task['test']
versions = ['2.2.2','2.1.1','2.0.4','1.2.6']
versions = ['2.3.2','2.2.2','2.1.1']
versions.each do |version|
ENV['RAILS_VERSION'] = "#{version}"
test.invoke
Expand Down
6 changes: 0 additions & 6 deletions grouped_scope.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ Gem::Specification.new do |s|
"test/grouped_scope/self_grouping_test.rb",
"test/helper.rb",
"test/lib/boot.rb",
"test/lib/core_ext.rb",
"test/lib/named_scope.rb",
"test/lib/named_scope/core_ext.rb",
"test/lib/named_scope/named_scope.rb",
"test/lib/named_scope/named_scope_patch_1.2.rb",
"test/lib/named_scope/named_scope_patch_2.0.rb",
"test/lib/test_case.rb" ]
s.rdoc_options = ["--main", "README.rdoc"]
s.extra_rdoc_files = ["README.rdoc","CHANGELOG","MIT-LICENSE"]
Expand Down
2 changes: 0 additions & 2 deletions lib/grouped_scope/has_many_association.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ def self.included(klass)

def construct_sql_with_group_scope
if @reflection.options[:grouped_scope]
# CHANGED [Rails 1.2.6] Account for quoted_table_name.
table_name = @reflection.respond_to?(:quoted_table_name) ? @reflection.quoted_table_name : @reflection.klass.table_name
if @reflection.options[:as]
# TODO: Need to add case for polymorphic :as option.
else
Expand Down
12 changes: 2 additions & 10 deletions test/grouped_scope/association_reflection_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ def setup
should 'delegate instance methods to #ungrouped_reflection' do
methods = [:class_name,:klass,:table_name,:primary_key_name,:active_record,
:association_foreign_key,:counter_cache_column,:source_reflection]
# CHANGED [Rails 1.2.6] Account for quoted_table_name.
methods << :quoted_table_name if @ungrouped_reflection.respond_to?(:quoted_table_name)
methods.each do |m|
assert_equal @ungrouped_reflection.send(m), @grouped_reflection.send(m),
"The method #{m.inspect} does not appear to be proxied to the ungrouped reflection."
Expand All @@ -54,17 +52,11 @@ def setup
end

should 'derive class name to same as ungrouped reflection' do
# CHANGED [Rails 1.2.6] Account for quoted_table_name.
if @ungrouped_reflection.respond_to?(:derive_class_name)
assert_equal @ungrouped_reflection.send(:derive_class_name), @grouped_reflection.send(:derive_class_name)
end
assert_equal @ungrouped_reflection.send(:derive_class_name), @grouped_reflection.send(:derive_class_name)
end

should 'derive primary key name to same as ungrouped reflection' do
# CHANGED [Rails 1.2.6] Account for quoted_table_name.
if @ungrouped_reflection.respond_to?(:derive_primary_key_name)
assert_equal @ungrouped_reflection.send(:derive_primary_key_name), @grouped_reflection.send(:derive_primary_key_name)
end
assert_equal @ungrouped_reflection.send(:derive_primary_key_name), @grouped_reflection.send(:derive_primary_key_name)
end

should 'honor explicit legacy reports association options like class_name and foreign_key' do
Expand Down
1 change: 0 additions & 1 deletion test/lib/boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@
gem 'mislav-will_paginate', '2.3.4'
require 'will_paginate'
WillPaginate.enable_activerecord
require 'named_scope'

20 changes: 0 additions & 20 deletions test/lib/core_ext.rb

This file was deleted.

7 changes: 0 additions & 7 deletions test/lib/named_scope.rb

This file was deleted.

82 changes: 0 additions & 82 deletions test/lib/named_scope/core_ext.rb

This file was deleted.

168 changes: 0 additions & 168 deletions test/lib/named_scope/named_scope.rb

This file was deleted.

Loading

0 comments on commit 85a743e

Please sign in to comment.