Skip to content

Commit

Permalink
Prevent exception in non-Rails environments.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreisner committed Jun 3, 2010
1 parent 0bdf1c3 commit 793c2a1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/geocoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,11 @@ def self._fetch_xml(query)
# Name of the ActiveRecord scope method.
#
def self.scope_method_name
Rails.version.starts_with?("3") ? :scope : :named_scope
begin
Rails.version.starts_with?("3") ? :scope : :named_scope
rescue NameError
:named_scope
end
end
end

Expand Down

0 comments on commit 793c2a1

Please sign in to comment.