Skip to content

Commit f9468ad

Browse files
committed
Avoid class_eval
1 parent b87d8e5 commit f9468ad

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

activerecord/lib/active_record/runtime_registry.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ class RuntimeRegistry # :nodoc:
1616

1717
attr_accessor :sql_runtime
1818

19-
[:sql_runtime].each do |val|
20-
class_eval %{ def self.#{val}; instance.#{val}; end }, __FILE__, __LINE__
21-
class_eval %{ def self.#{val}=(x); instance.#{val}=x; end }, __FILE__, __LINE__
22-
end
19+
def self.sql_runtime; instance.sql_runtime; end
20+
def self.sql_runtime=(x); instance.sql_runtime = x; end
2321
end
2422
end

0 commit comments

Comments
 (0)