module ActiveModel::AttributeMethods

def guard_private_attribute_method!(method_name, args)

prevent method_missing from calling private methods with #send
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