Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adds Rails 3.1 compatibility

  • Loading branch information...
commit 1f1d9b77590534bca57e0d192b250b771bb2ebbd 1 parent 9a519eb
Benedikt Deicke authored
2  filter_fu.gemspec
View
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.files = Dir.glob('{lib,spec}/**/*') + %w(LICENSE README.rdoc Rakefile Gemfile Gemfile.lock .rspec)
- s.add_runtime_dependency('rails', ['~> 3.0.0'])
+ s.add_runtime_dependency('rails', ['~> 3.0'])
s.add_development_dependency('rspec', ['~> 2.0'])
s.add_development_dependency('rspec-rails', ['~> 2.0'])
s.add_development_dependency('webrat', ['>= 0.7.2'])
2  lib/filter_fu/active_record.rb
View
@@ -29,7 +29,7 @@ def filtered_by(filter)
filter.inject(self) do |memo, (scope, arg)|
scope = scope.to_sym
next if protected?(scope)
- if scopes.has_key?(scope)
+ if memo.respond_to?(scope)
memo.send(scope, arg)
else
memo.scoped(build_anonymous_scope(scope, arg))
1  spec/active_record_spec.rb
View
@@ -87,6 +87,7 @@
it "should only call the specified named scope if it is available" do
@class.should_not_receive(:unavailable)
+ @class.stub(:respond_to?).with(:unavailable).and_return(false)
@class.filtered_by({ :unavailable => '' })
end
Please sign in to comment.
Something went wrong with that request. Please try again.