Sha256: f50e23a0b31af85a1e1f53ac5efc4bf16d309ee4c83bd9ea2039875e29b73919

Contents?: true

Size: 346 Bytes

Versions: 3

Compression:

Stored size: 346 Bytes

Contents

# frozen_string_literal: true

module Phlex
	module Rails
		module HTML
			module AppendMethodAddedWarning
				def method_added(name)
					if name == :append || name == :safe_append
						raise Phlex::NameError, "You shouldn't redefine the #{name} method as it's required for safe HTML output."
					end

					super
				end
			end
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
phlex-rails-0.6.1 lib/phlex/rails/html/append_method_added_warning.rb
phlex-rails-0.6.0 lib/phlex/rails/html/append_method_added_warning.rb
phlex-rails-0.5.1 lib/phlex/rails/html/append_method_added_warning.rb