Skip to content

Commit

Permalink
Merge pull request sunspot#299 from scho/master
Browse files Browse the repository at this point in the history
Sunspot::Search::PaginatedCollection and send
  • Loading branch information
alindeman committed Nov 20, 2012
2 parents 89d7dae + 06c227b commit eb5fac0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sunspot/lib/sunspot/search/paginated_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Sunspot
module Search

class PaginatedCollection
instance_methods.each { |m| undef_method m unless m =~ /^__|instance_eval|object_id/ }
instance_methods.each { |m| undef_method m unless m =~ /^__|instance_eval|object_id|send/ }

attr_reader :current_page, :per_page
attr_accessor :total_count
Expand Down
4 changes: 4 additions & 0 deletions sunspot/spec/api/search/paginated_collection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

it { subject.should be_an(Array) }

it 'should allow send' do
subject.send(:current_page).should eql(1)
end

context "behaves like a WillPaginate::Collection" do
it { subject.total_entries.should eql(20) }
it { subject.total_pages.should eql(2) }
Expand Down

0 comments on commit eb5fac0

Please sign in to comment.