Skip to content

Commit

Permalink
Fixed error with determining whether to use Rails 3 scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kroes committed Oct 28, 2010
1 parent a3e052d commit 36eb9b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ancestry/has_ancestry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def has_ancestry options = {}

# Save ActiveRecord version
self.cattr_accessor :rails_3
self.rails_3 = defined?(ActiveRecord::VERSION) and ActiveRecord::VERSION::MAJOR >= 3
self.rails_3 = defined?(ActiveRecord::VERSION) && ActiveRecord::VERSION::MAJOR >= 3

# Workaround to support Rails 2
scope_method = if rails_3 then :scope else :named_scope end
Expand Down

0 comments on commit 36eb9b9

Please sign in to comment.