module ActiveModel::AttributeMethods
def guard_private_attribute_method!(method_name, args)
def guard_private_attribute_method!(method_name, args) if self.class.private_method_defined?(method_name) raise NoMethodError.new("Attempt to call private method", method_name, args) end end