active_model_serializers/test
Mauro George 51424963da ActiveSupport::Notifications render.active_model_serializers
Squashed commits:

Add Logging

Generates logging when renders a serializer.

Tunning performance on notify_active_support

- Use yield over block.call
- Freeze the event name string

Organize the logger architeture

* Keep only the `ActiveModel::Serializer.logger` to follow the same public API we
  have for example to config, like `ActiveModel::Serializer.config.adapter` and
  remove the `ActiveModelSerializers.logger` API.
* Define the logger on the load of the AMS, following the Rails convention on
  Railties [1], [2] and [3].

This way on non Rails apps we have a default logger and on Rails apps we will
use the `Rails.logger` the same way that Active Job do [4].

[1]: 2ad9afe4ff/activejob/lib/active_job/railtie.rb (L9-L11)
[2]: 2ad9afe4ff/activerecord/lib/active_record/railtie.rb (L75-L77)
[3]: 2ad9afe4ff/actionview/lib/action_view/railtie.rb (L19-L21)
[4]: 2ad9afe4ff/activejob/lib/active_job/logging.rb (L10-L11)

Performance tunning on LogSubscriber#render

Move the definition of locals to inside the `info` block this way the code is
executed only when the logger is called.

Remove not needed check on SerializableResource

Use SerializableResource on ActionController integration

On the ActionController was using a adapter, and since the instrumentation is
made on the SerializableResource we need to use the SerializableResource over
the adapter directly. Otherwise the logger is not called on a Rails app.

Use SerializableResource on the ActionController, since this is the main
interface to create and call a serializer.

Using always the SerializableResource we can keep the adapter code more easy to
mantain since no Adapter will need to call the instrumentation, only the
SerializableResource care about this.

Add docs about logging

Add a CHANGELOG entry

Keep the ActiveModelSerializers.logger

Better wording on Logging docs

[ci skip]

Add doc about instrumentation

[ci skip]

Use ActiveModel::Callbacks on the SerializableResource
2015-11-10 03:09:24 -06:00
..
action_controller ActiveSupport::Notifications render.active_model_serializers 2015-11-10 03:09:24 -06:00
active_model_serializers rename context to serialization_context 2015-11-07 20:32:27 +01:00
adapter rename context to serialization_context 2015-11-07 20:32:27 +01:00
fixtures Rename ArraySerializer to CollectionSerializer for clarity 2015-10-21 16:53:26 -05:00
generators Remove space in {} 2015-09-03 20:55:40 -05:00
include_tree Add test and bugfix to include an array of string 2015-11-06 17:23:25 +01:00
serializers Only use subclasses of ActiveModel::Serializer during lookup. 2015-10-23 17:17:03 +02:00
support Add support for top level jsonapi member. 2015-10-01 21:22:49 -05:00
active_record_test.rb Add lint tests for AR models. 2015-09-07 18:34:42 +02:00
adapter_test.rb Introduce Adapter::Base 2015-09-20 12:26:04 -05:00
array_serializer_test.rb Rename ArraySerializer to CollectionSerializer for clarity 2015-10-21 16:53:26 -05:00
capture_warnings.rb Merge pull request #1175 from bf4/quiet_success_messages 2015-09-21 09:31:49 -05:00
collection_serializer_test.rb Rename ArraySerializer to CollectionSerializer for clarity 2015-10-21 16:53:26 -05:00
lint_test.rb Add PORO serializable base class: ActiveModelSerializers::Model 2015-10-14 21:33:02 -05:00
logger_test.rb rubocop-fixes 2015-09-15 14:58:04 -04:00
logging_test.rb ActiveSupport::Notifications render.active_model_serializers 2015-11-10 03:09:24 -06:00
poro_test.rb Lead by example: lint PORO model 2015-08-18 12:59:12 -04:00
serializable_resource_test.rb Encapsulate serialization in ActiveModel::SerializableResource 2015-07-23 11:05:23 -05:00
test_helper.rb Better reporter for tests. 2015-10-06 02:15:29 +02:00