Skip to content

Commit

Permalink
Fix a deprecation warning in Rails 2.3.6 and newer
Browse files Browse the repository at this point in the history
  • Loading branch information
mjonuschat committed Jun 17, 2010
1 parent a78232c commit 051457b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/formtastic/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ def html_safe(text)
end

def rails_safe_buffer_class
return ActionView::SafeBuffer if defined?(ActionView::SafeBuffer)
ActiveSupport::SafeBuffer
# It's important that we check ActiveSupport first,
# because in Rails 2.3.6 ActionView::SafeBuffer exists
# but is a deprecated proxy object.
return ActiveSupport::SafeBuffer if defined?(ActiveSupport::SafeBuffer)
return ActionView::SafeBuffer
end

end
Expand Down

0 comments on commit 051457b

Please sign in to comment.