mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
da914fa35c
When you've got an AR Model and you override the `as_json` method, you should be able to add default options to the renderer, like this: class User < ActiveRecord::Base def as_json(options = {}) super(options.merge(:except => [:password_digest])) end end This was not possible before this commit. See the added test case. |
||
---|---|---|
.. | ||
mass_assignment_security | ||
serializers | ||
validations | ||
attribute_methods_test.rb | ||
callbacks_test.rb | ||
conversion_test.rb | ||
dirty_test.rb | ||
errors_test.rb | ||
helper.rb | ||
lint_test.rb | ||
mass_assignment_security_test.rb | ||
naming_test.rb | ||
observer_array_test.rb | ||
observing_test.rb | ||
secure_password_test.rb | ||
serialization_test.rb | ||
translation_test.rb | ||
validations_test.rb |