1
module ActiveSupport #:nodoc:
2
module CoreExtensions #:nodoc:
5
def self.included(base)
7
alias_method :add_without_safety, :+
8
alias_method :+, :add_with_safety
9
alias_method_chain :concat, :safety
11
alias_method :<<, :concat_with_safety
16
defined?(@_rails_html_safe) && @_rails_html_safe
20
@_rails_html_safe = true
24
def add_with_safety(other)
25
result = add_without_safety(other)
26
if html_safe? && also_html_safe?(other)
33
def concat_with_safety(other_or_fixnum)
34
result = concat_without_safety(other_or_fixnum)
35
unless html_safe? && also_html_safe?(other_or_fixnum)
36
@_rails_html_safe = false
42
def also_html_safe?(other)
43
other.respond_to?(:html_safe?) && other.html_safe?
b'\\ No newline at end of file'