diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2009-12-27 14:44:21 -0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2009-12-27 14:44:21 -0800 |
commit | 5012a1558dd1483df525f1fac1e649e089be886a (patch) | |
tree | 983136a50ee7bb135768038e33c9c226a3a167ed /activesupport/lib/active_support | |
parent | 1cd949006a419807d5ae3400442942b752780ca2 (diff) | |
parent | 12e43494a748e0144195be12dc19161cc3e4d39f (diff) | |
download | rails-5012a1558dd1483df525f1fac1e649e089be886a.tar.gz rails-5012a1558dd1483df525f1fac1e649e089be886a.tar.bz2 rails-5012a1558dd1483df525f1fac1e649e089be886a.zip |
Merge branch 'master' of github.com:rails/rails
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 |