Commit Graph

805 Commits

Author SHA1 Message Date
Benjamin Fleischer
87d18e9c32 Map attributes to Attribute values when defined in serializer 2015-12-02 17:20:22 -06:00
Benjamin Fleischer
b3b9a46eeb Merge pull request #1358 from rwstauner/dirs-with-spaces
Match file paths with spaces in caller regexp
2015-12-02 10:23:40 -06:00
Randy Stauner
90fa377040 Match file paths with spaces in caller regexp 2015-12-02 06:17:34 -07:00
L. Preston Sego III
2dc78c5916 add information about server side changes 2015-12-01 14:49:57 -05:00
Benjamin Fleischer
97ab80565b Merge pull request #1357 from y-yagi/fix_description_of_usage
fix description of USAGE
2015-12-01 12:51:48 -06:00
yuuji.yaginuma
d8998a4877 fix description of USAGE 2015-12-01 08:54:27 +09:00
Benjamin Fleischer
28394340d8 Add config.serializer_lookup_enabled that defaults true 2015-11-30 00:20:58 -06:00
Benjamin Fleischer
47a14b6581 Improve ActionController::Serialization readability 2015-11-30 00:15:02 -06:00
Trek Glowacki
170db3ba88 Allow users to globally opt out of automatic lookup 2015-11-30 00:15:02 -06:00
L. Preston Sego III
21fe3abdfc make issue number a link 2015-11-27 08:43:15 -05:00
L. Preston Sego III
21873130bb update docs with integration table, and remove the grape placeholder for now 2015-11-27 08:41:29 -05:00
Benjamin Fleischer
8aaaa44ba3 Merge pull request #1324 from rails-api/get_tests_running_on_rails_master
Get tests passing on Rails 5
2015-11-25 22:49:10 -06:00
Benjamin Fleischer
4590161abc Merge pull request #1349 from bf4/allow_ruby_head_failures
Add more warnings ignore directories
2015-11-25 22:07:26 -06:00
Benjamin Fleischer
6588dee22c Rails5 requires x_action 2015-11-25 22:06:20 -06:00
Benjamin Fleischer
c56d49f26b Test keyword args in requests for Rails 5; fallback for earlier versions
kwargs: params,session,flash,method,body

Fix Rails 5 DEPRECATION WARNING
2015-11-25 21:56:02 -06:00
Benjamin Fleischer
3b87cb3593 Patch ActionController::TestCase#assigns for Rails5 2015-11-25 21:56:01 -06:00
Benjamin Fleischer
7d707aabdc Update Gemfile/gemspec dependencies for Rails 5/master 2015-11-25 21:56:01 -06:00
Benjamin Fleischer
d2a11678ef ActiveModel::AttributeAssignment requires Model#respond_to_missing? 2015-11-25 21:56:01 -06:00
Benjamin Fleischer
a9ce4fb766 Move caching initialization to Railtie
Also
- Add reference to config from ActiveModelSerializers.config
- correctly call super in FragmentCacheTest#setup
- rename test rails app from Foo to ActiveModelSerializers::RailsApplication
2015-11-25 21:56:01 -06:00
Benjamin Fleischer
2bea7f94f3 Require CI to pass on Rails master (Rails 5) 2015-11-25 21:56:01 -06:00
Benjamin Fleischer
3dffd8a8b7 Add more warnings ignore directories 2015-11-25 21:49:23 -06:00
Benjamin Fleischer
5d0cc5990a Merge pull request #1341 from johnhamelink/fix-travis
Fix bundler caching in travis & Appveyor
2015-11-24 11:25:41 -06:00
Benjamin Fleischer
bca72207ff Merge pull request #1343 from wagenet/typo
Fix typo
2015-11-24 09:42:41 -06:00
Peter Wagenet
39ef9bff10 Fix typo 2015-11-24 07:22:59 -08:00
John Hamelink
defd8d05c9 Fix bundler caching in travis & Appveyor
- Point gems to vendor/bundle in travis.yml
 - Point Travis cache to vendor/bundle
 - Point Appveyor cache to vendor/bundle
2015-11-24 01:53:45 +00:00
Benjamin Fleischer
aa4384839d Merge pull request #1322 from bf4/maurogeorge-patch-10
Instrumenting rendering of resources
2015-11-19 13:01:38 -06:00
Benjamin Fleischer
03653032c5 Merge pull request #1323 from bf4/fix_deprecations_config
Use Minitest::Reporters to capture warnings && show error output
2015-11-19 12:50:07 -06:00
Benjamin Fleischer
733f5bca7e Rename event from AMS to active_model_serializers
per NullVoxPopuli comment
2015-11-19 12:44:33 -06:00
Benjamin Fleischer
d1c44c719d Update for review per maurogeorge feedback 2015-11-19 12:41:51 -06:00
Benjamin Fleischer
b36cc42f03 Separate out callbacks per ActiveJob pattern 2015-11-10 03:09:24 -06:00
Benjamin Fleischer
e8efc4eff4 Refactor callbacks in ams::logging 2015-11-10 03:09:24 -06:00
Benjamin Fleischer
84c3b11491 Use null logger in test; keep track of original logger 2015-11-10 03:09:24 -06:00
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
Benjamin Fleischer
14a06d96c4 Only capture stderr on Ruby 2.1 on CI
Always show warnings in tests
2015-11-09 00:35:02 -06:00
Benjamin Fleischer
e5a109865c Test ArraySerializer less rigorously on Minitest 4 2015-11-08 23:12:56 -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
L. Preston Sego III
4cb5ad08e7 update ember docs with ember-data issue tracking urlForFindRecord / the inability to use query params on a single resource find 2015-10-30 14:10:17 -04:00
L. Preston Sego III
168ec0ec2a begin integration docs 2015-10-30 13:58:42 -04: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