GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
In wrap_parameters.rb template there are lines:
# To enable root element in JSON for ActiveRecord objects.
# ActiveSupport.on_load(:active_record) do
# self.include_root_in_json = true
This is formulated in a way that makes user think it is disabled by default, and you have to uncomment the lines to enable it.
But actually it is enabled by default:
self.include_root_in_json = true
Is it OK to change the initializer template?
this definitely feels strange.
@rafaelfranca @carlosantoniodasilva do you know what changed here?
Yes, I think so, the default include_root_in_json has been changed in master, so the initializer is outdated.
should we change the initializer to say = false or remove it?
Hm actually, it's Active Model that has changed, here: ab11a27
yes, AM's default is false, but AR's default is true