diff options
author | Yehuda Katz <wycats@Yehuda-Katz.local> | 2009-12-27 14:36:59 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@Yehuda-Katz.local> | 2009-12-27 14:36:59 -0800 |
commit | 12e43494a748e0144195be12dc19161cc3e4d39f (patch) | |
tree | c06f88b7ddf6e41205838cc6f4edd2257a801dcb /activesupport/lib/active_support | |
parent | 1c26ba486c23f229a12fea6ccad33e6cb3122b91 (diff) | |
parent | 97db79ab3c0af7b6805dcaee99384d96ccb3567d (diff) | |
download | rails-12e43494a748e0144195be12dc19161cc3e4d39f.tar.gz rails-12e43494a748e0144195be12dc19161cc3e4d39f.tar.bz2 rails-12e43494a748e0144195be12dc19161cc3e4d39f.zip |
Merge remote branch 'jose/perf'
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/output_safety.rb | 12 | ||||
-rw-r--r-- | activesupport/lib/active_support/notifications/instrumenter.rb | 11 |
2 files changed, 17 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb index 3e6ab0ebd2..ceed90ce79 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -1,3 +1,15 @@ +class Object + def html_safe? + false + end +end + +class Fixnum + def html_safe? + true + end +end + class String attr_accessor :_rails_html_safe alias html_safe? _rails_html_safe diff --git a/activesupport/lib/active_support/notifications/instrumenter.rb b/activesupport/lib/active_support/notifications/instrumenter.rb index fb95422af2..0655dd0cb6 100644 --- a/activesupport/lib/active_support/notifications/instrumenter.rb +++ b/activesupport/lib/active_support/notifications/instrumenter.rb @@ -10,10 +10,10 @@ module ActiveSupport end def instrument(name, payload={}) - time = Time.now - result = yield if block_given? + time = Time.now + yield if block_given? ensure - @notifier.publish(name, time, Time.now, result, @id, payload) + @notifier.publish(name, time, Time.now, @id, payload) end private @@ -23,15 +23,14 @@ module ActiveSupport end class Event - attr_reader :name, :time, :end, :transaction_id, :result, :payload + attr_reader :name, :time, :end, :transaction_id, :payload - def initialize(name, start, ending, result, transaction_id, payload) + def initialize(name, start, ending, transaction_id, payload) @name = name @payload = payload.dup @time = start @transaction_id = transaction_id @end = ending - @result = result end def duration |