Commit Graph

1481 Commits

Author SHA1 Message Date
Benjamin Fleischer
1301b52696 Merge branch 'supported_ruby_changes'
Closes #1360, #1369

- @karaAJC updated CI Ruby from 2.2.2 to 2.2.3
- @karaAJC updated CI Ruby to remove Ruby 1.9.3
- @maurogeorge updated gemspec to require Ruby >= 2.0.0
2015-12-14 14:24:11 -06:00
Benjamin Fleischer
60ac749edf Cleanup CHANGELOG 2015-12-14 14:21:55 -06:00
Mauro George
488370fc0b Drop support to Ruby 1.9.3 2015-12-14 14:18:29 -06:00
Kara Carrell
850ac3feaf drop support to Ruby 1.9.3 from build matrix 2015-12-14 14:18:06 -06:00
Kara Carrell
338868a450 Update travis build matrix to include Ruby 2.2.3 for Rails 5 2015-12-14 14:18:06 -06:00
Benjamin Fleischer
f562449bd4 Merge pull request #1356 from bf4/attribute_objects
Add inline syntax for attributes and associations
2015-12-10 15:10:45 -06:00
Benjamin Fleischer
bf8270b8b4 Document Serializer settings and private api [ci skip] 2015-12-10 15:08:22 -06:00
Julian Paas
d85a17bb33 Grape formatter feature requested in #1258
- adds handling for when the returned resource is not serializable via ams
 - fix for when resource is an Array
 - Moves grape include to grape namespace. Changes Enumerable to Array because a plain hash is enumerable.
 - Add integration test
 - Refine scope of Grape version dependency
 - Assert that the response is equal to a manually defined JSON string
 - Add single module to include in Grape projects
 - Create a Serializable Resource to test rails-api from Grape
 - Update docs
 - Fix discrepency between ActiveRecord 4.0 - 4.1 and 4.2
 - Updated Changelog
 - Remove parens from `render`, use `serializable` in all tests.
2015-12-10 10:06:40 +00:00
Benjamin Fleischer
614e349502 Merge pull request #1301 from rails-api/jsonapi_schema
Mapping JSON API spec / schema to AMS [ci skip]
2015-12-09 17:08:57 -06:00
Benjamin Fleischer
d64c7e11d6 Merge pull request #1364 from johnathanludwig/update_issue_links
[DOCS] Update links to point to correct PRs
2015-12-04 15:15:12 -06:00
Johnathan Ludwig
269e11f360 Update links to point to correct PRs 2015-12-04 16:10:29 -05:00
Benjamin Fleischer
386a567dfc Evaluate association blocks as scopes on the association 2015-12-04 13:58:22 -06:00
Benjamin Fleischer
3e8290a923 Serializer instance methods don't change; track at class level
Per groyoh
https://github.com/rails-api/active_model_serializers/pull/1356#discussion_r46713503
2015-12-04 13:31:34 -06:00
Benjamin Fleischer
5301112c27 Merge pull request #1312 from NullVoxPopuli/integration-docs
[DOCS] begin integration docs
2015-12-03 11:26:06 -06:00
Benjamin Fleischer
c4feccfd10 Refactor Association/Reflection block value reading 2015-12-03 10:53:43 -06:00
Benjamin Fleischer
cd736e0adf Memoize attributes 2015-12-02 17:47:24 -06:00
Benjamin Fleischer
036604b149 Extract Serializer Attributes into its own file 2015-12-02 17:45:42 -06:00
Benjamin Fleischer
eceb2d5598 Refactor serializer attribute objects 2015-12-02 17:33:57 -06:00
Benjamin Fleischer
8804d758ef Remove dynamically defined instance methods 2015-12-02 17:20:22 -06:00
Benjamin Fleischer
0bf45ec2a7 Small refactor to Serializer::_attribute_mappings 2015-12-02 17:20:22 -06:00
Noah Silas
7bde7bf752 Handle conflicts between key names and serializer methods
As an example, all serializers implement `#object` as a reference to the
object being esrialized, but this was preventing adding a key to the
serialized representation with the `object` name.

Instead of having attributes directly map to methods on the serializer,
we introduce one layer of abstraction: the `_attributes_map`. This hash
maps the key names expected in the output to the names of the
implementing methods.

This simplifies some things (removing the need to maintain both
`_attributes` and `_attribute_keys`), but does add some complexity in
order to support overriding attributes by defining methods on the
serializer. It seems that with the addition of the inline-block format,
we may want to remove the usage of programatically defining methods on
the serializer for this kind of customization.
2015-12-02 17:20:22 -06:00
Benjamin Fleischer
e2903643c5 Encapsulate serialized_associations; test inline associations 2015-12-02 17:20:22 -06:00
Lucas Hosseini
7cbef1b3b5 Add inline syntax for defining associations
Adapted from
https://github.com/rails-api/active_model_serializers/pull/1262
2015-12-02 17:20:22 -06:00
Benjamin Fleischer
6020450fe4 Allow specifying attributes with a block
Adapted from https://github.com/rails-api/active_model_serializers/pull/1262
2015-12-02 17:20:22 -06:00
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