Benjamin Fleischer
360ecc88fe
Clean up notification code with some meta-prog
2015-11-10 03:09:24 -06:00
Benjamin Fleischer
21bb306d38
Keep Logging in the ActiveModelSerializers namespace
2015-11-10 03:09:24 -06:00
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
L. Preston Sego III
efe5128a2e
Merge pull request #1313 from tchak/serialization_context
...
rename context to serialization_context
2015-11-07 18:54:54 -05:00
tchak
31172b1be5
rename context to serialization_context
2015-11-07 20:32:27 +01:00
L. Preston Sego III
e6d1d6be0c
Merge pull request #1320 from barodeur/include-array-of-string
...
Add test and bugfix to include an array of string
2015-11-06 11:58:06 -05:00
Paul Chobert
6407dbeadd
Add test and bugfix to include an array of string
2015-11-06 17:23:25 +01:00
L. Preston Sego III
0200d89da8
Merge pull request #1246 from beauby/jsonapi-resource-links
...
Add support for resource-level JSON API links.
2015-11-04 12:12:11 -05:00
Lucas Hosseini
8ac2b9b01f
Minor cleanup.
2015-11-03 23:59:12 +01:00
Lucas Hosseini
3804dcc238
Add support for resource-level JSON API links.
2015-11-03 23:50:16 +01:00
L. Preston Sego III
827a623d16
Merge pull request #1315 from beauby/optim-attributes
...
Compute only requested attributes.
2015-10-31 14:58:24 -04:00
Lucas Hosseini
0948c4199a
Compute only requested attributes.
2015-10-31 19:20:53 +01:00
Lucas Hosseini
831921ff07
Update adapters.md
...
Fix typos.
2015-10-31 18:51:10 +01:00
Lucas Hosseini
fee37d5c00
Merge pull request #1304 from NullVoxPopuli/ember-findRecord-include-how-to
...
Add docs for Ember.
2015-10-30 18:42:07 +01:00
L. Preston Sego III
11d8fee4d0
added docs for setting up ember for nested resources with the json api adapter
...
fix typo
fix intra-document links
fix spelling error in nested resources toc link
add example for post collection
Update ember-and-json-api.md
fix typo
2015-10-30 13:25:08 -04:00
L. Preston Sego III
ecc3b35517
Merge pull request #1309 from rails-api/revert-1289-serialization_context
...
Revert "rename context to serialization_context and add url helpers"
2015-10-29 08:17:06 -04:00
L. Preston Sego III
17be650538
Revert "rename context to serialization_context and add url helpers"
2015-10-29 08:16:47 -04:00
L. Preston Sego III
a063cbea21
Merge pull request #1289 from tchak/serialization_context
...
rename context to serialization_context and add url helpers
2015-10-29 07:56:47 -04:00
L. Preston Sego III
65b8493e51
Merge pull request #1224 from bf4/rake_ci
...
Separate default rake from rake ci
2015-10-26 20:22:55 -04:00
L. Preston Sego III
48b041ecae
Merge pull request #1294 from beauby/fix-serializer-lookup-non-ams
...
Only use subclasses of ActiveModel::Serializer during lookup.
2015-10-25 23:01:00 -04:00
L. Preston Sego III
55ff9acd75
Merge pull request #1297 from beauby/fix-jsonapi-fields
...
Fix `fields` option to restrict relationships as well.
2015-10-25 22:42:11 -04:00
Lucas Hosseini
b5aecfd114
Initialize fieldset.
2015-10-25 19:56:43 +01:00
Lucas Hosseini
13ef8fed1b
Fix fields option to restrict relationships as well.
2015-10-24 21:28:13 +02:00
Lucas Hosseini
1a42345d84
Only use subclasses of ActiveModel::Serializer during lookup.
2015-10-23 17:17:03 +02:00
Benjamin Fleischer
f3403c302c
Merge pull request #1292 from bf4/master
...
Remove errant line [ci skip]
2015-10-22 21:02:09 -05:00
Benjamin Fleischer
0a27f8a1ba
Remove errant line [ci skip]
2015-10-22 20:52:40 -05:00
Benjamin Fleischer
7136a24319
Remove errant line [ci skip]
2015-10-22 20:48:41 -05:00
tchak
d08ee5994f
rename context to serialization_context and add url helpers
2015-10-22 22:28:54 +02:00
Benjamin Fleischer
86fa7a9bfc
Merge pull request #1260 from bf4/serializer_cache_digest
...
Serialization and Cache Documentation
2015-10-22 11:39:09 -05:00
Benjamin Fleischer
9e3cf0241d
Separate default rake from rake ci
2015-10-22 10:45:24 -05:00
Benjamin Fleischer
9b0c86546b
Merge pull request #1253 from rails-api/architecture
...
Describe AMS architecture in the big picture
2015-10-22 10:37:46 -05:00
Benjamin Fleischer
274cb66d34
Edits per beauby [ci skip]
2015-10-22 10:31:21 -05:00
Lucas Hosseini
63317699f3
Correct minor typos
2015-10-22 10:31:21 -05:00
Benjamin Fleischer
80e75202ea
Document Serializer and FragmentCache
2015-10-22 10:31:21 -05:00
Benjamin Fleischer
8e1245a5b2
Merge pull request #1251 from bf4/collection_serializer
...
Rename ArraySerializer to CollectionSerializer for clarity
2015-10-22 10:29:02 -05:00
Lucas Hosseini
d3a8006562
Wording and typos.
2015-10-22 04:02:51 +02:00
Benjamin Fleischer
2c8b9b796d
Rename ArraySerializer to CollectionSerializer for clarity
2015-10-21 16:53:26 -05:00
Benjamin Fleischer
a5defcb0aa
Describe AMS architecture in the big picture [ci skip]
2015-10-21 16:19:00 -05:00
João Moura
73cb9f7a1f
Merge pull request #1259 from rails-api/creating_an_issue
...
Add more info to CONTRIBUTING
2015-10-21 16:02:11 -05:00
Benjamin Fleischer
fcf5f8caba
Edits per joaomdmoura [ci skip]
2015-10-21 15:44:39 -05:00
Benjamin Fleischer
737784c9b7
Merge pull request #1272 from bf4/add_public_poro_base
...
Add PORO serializable base class: ActiveModelSerializers::Model
2015-10-20 12:50:05 -05:00
L. Preston Sego III
b2cd7bb51a
Merge pull request #1271 from bf4/fix_digest_failure
...
Handle no serializer source file to digest.
2015-10-16 09:23:56 -04:00
Benjamin Fleischer
8c52c36ae1
Edit per beauby [ci skip]
2015-10-15 23:39:21 -05:00
L. Preston Sego III
240387bc45
Merge pull request #1242 from beauby/improve-ministest
...
Better reporter for tests.
2015-10-15 16:39:53 -04:00
Benjamin Fleischer
124faaa829
Add PORO serializable base class: ActiveModelSerializers::Model
2015-10-14 21:33:02 -05:00
Benjamin Fleischer
8529ea43c9
Handle no serializer source file to digest.
...
output warning
Closes #1176
2015-10-14 20:56:29 -05:00
Benjamin Fleischer
285dd6d0e7
Add more info to CONTRIBUTING [ci skip]
2015-10-14 17:42:35 -05:00
Benjamin Fleischer
200625fd02
Add image from commit strip [ci skip]
...
http://www.commitstrip.com/en/2014/05/07/the-truth-behind-open-source-apps/
2015-10-14 17:41:15 -05:00
Lucas Hosseini
526b56e9a6
Merge pull request #1267 from hudsonsferreira/master
...
Fix typos on README and improve CONTRIBUTING description.
2015-10-15 00:16:46 +02:00
Hudson
b3b3fdc7a4
Improve documentation: fixed typos on Readme and added dollar sign at Contributing [ci skip]
2015-10-14 13:45:10 -03:00