active_model_serializers/lib/active_model/serializer
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
..
adapter rename context to serialization_context 2015-11-07 20:32:27 +01:00
adapter.rb Enforce Rails-style (line-count-based) block style 2015-09-21 00:00:53 -05:00
array_serializer.rb Rename ArraySerializer to CollectionSerializer for clarity 2015-10-21 16:53:26 -05:00
association.rb Rubocop: Consistent spacing 2015-09-03 20:51:40 -05:00
associations.rb Fixes #1211 - retrieve the key from the reflection options when building associations 2015-10-02 08:52:21 -04:00
belongs_to_reflection.rb Associations refactoring 2015-07-30 11:20:29 +03:00
collection_reflection.rb Associations refactoring 2015-07-30 11:20:29 +03:00
collection_serializer.rb Rename ArraySerializer to CollectionSerializer for clarity 2015-10-21 16:53:26 -05:00
configuration.rb Rename ArraySerializer to CollectionSerializer for clarity 2015-10-21 16:53:26 -05:00
fieldset.rb Initialize fieldset. 2015-10-25 19:56:43 +01:00
has_many_reflection.rb Associations refactoring 2015-07-30 11:20:29 +03:00
has_one_reflection.rb Associations refactoring 2015-07-30 11:20:29 +03:00
include_tree.rb Add test and bugfix to include an array of string 2015-11-06 17:23:25 +01:00
lint.rb Add PORO serializable base class: ActiveModelSerializers::Model 2015-10-14 21:33:02 -05:00
logging.rb ActiveSupport::Notifications render.active_model_serializers 2015-11-10 03:09:24 -06:00
railtie.rb Revert "rename context to serialization_context and add url helpers" 2015-10-29 08:16:47 -04:00
reflection.rb Rename ArraySerializer to CollectionSerializer for clarity 2015-10-21 16:53:26 -05:00
singular_reflection.rb Associations refactoring 2015-07-30 11:20:29 +03:00
version.rb updating version to new release 2015-09-16 12:19:44 -03:00