diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..03ed5e7 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,12 @@ +*0.2* (September 29th 2008) + +* Add WillPaginate test and confirm grouped scope, named scope, and will paginate all play together. [Ken Collins] + +* Stronger back port for named_scope in 1.2.6 and 2.0.4. Fixed bug where association proxy owner scope was after named_scope calls. [Ken Collins] + + +*0.1* (September 26th, 2008) + +* Initial public release. [Ken Collins] + + diff --git a/lib/grouped_scope.rb b/lib/grouped_scope.rb index 1d425eb..ec70452 100644 --- a/lib/grouped_scope.rb +++ b/lib/grouped_scope.rb @@ -8,7 +8,7 @@ module GroupedScope - VERSION = '0.1' + VERSION = '0.2' end diff --git a/test/grouped_scope/has_many_association_test.rb b/test/grouped_scope/has_many_association_test.rb index fd9689f..8504472 100644 --- a/test/grouped_scope/has_many_association_test.rb +++ b/test/grouped_scope/has_many_association_test.rb @@ -99,6 +99,17 @@ def setup end end + context 'with will paginate' do + + should 'use group reflection, named scope, and paginate SQL' do + where_ends_with_limits = /WHERE.*LIMIT 2 OFFSET 0/ + assert_sql(select_from_reports, where_for_groups, where_for_urgent_body, where_for_urgent_title, where_ends_with_limits) do + @e2.group.reports.with_urgent_title.with_urgent_body.paginate(:page=>1,:per_page=>2) + end + end + + end + end end diff --git a/test/lib/boot.rb b/test/lib/boot.rb index 3967d3d..d01aba0 100644 --- a/test/lib/boot.rb +++ b/test/lib/boot.rb @@ -25,9 +25,14 @@ require 'active_record' require 'active_support' +gem 'mislav-will_paginate', '2.3.4' +require 'will_paginate' +WillPaginate.enable_activerecord + unless defined? ActiveRecord::NamedScope require 'core_ext' require 'named_scope' require ActiveRecord::Base.respond_to?(:find_first) ? 'named_scope_patch_1.2.6' : 'named_scope_patch_2.0' ActiveRecord::Base.send :include, GroupedScope::NamedScope end +