Skip to content

Commit

Permalink
Silence scope resolution warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Jun 11, 2008
1 parent 65bc8f3 commit e6c1f46
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions activerecord/lib/active_record/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1903,10 +1903,12 @@ def current_scoped_methods #:nodoc:
# MyApp::Business::Account would appear as MyApp::Business::AccountSubclass.
def compute_type(type_name)
modularized_name = type_name_with_module(type_name)
begin
class_eval(modularized_name, __FILE__, __LINE__)
rescue NameError
class_eval(type_name, __FILE__, __LINE__)
silence_warnings do
begin
class_eval(modularized_name, __FILE__, __LINE__)
rescue NameError
class_eval(type_name, __FILE__, __LINE__)
end
end
end

Expand Down

0 comments on commit e6c1f46

Please sign in to comment.