json_api_toolbox 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd1e3f891e8f64704860ee926afb2100d1727067
4
- data.tar.gz: 9305a875726bda9797388edd993166606612355c
3
+ metadata.gz: cd600ecb379a51219160d4df9c365339321ce1c2
4
+ data.tar.gz: 0f1371e0aa8e7cbe8e1d20fba2ff10395ad57ae6
5
5
  SHA512:
6
- metadata.gz: 2021cb6298a046fe5f1d7f588ae39dc98f31b8fb2afa18d6cb167d100f9f1b7dcd825bde14e4691977d30d69ab4b85faca7b89dddcf7dfb29773475c77b7b905
7
- data.tar.gz: 6fef6ce899ebe9992f1dadce753242cb9372a82ebe2421dde28e9687597fadab1c1a3ef715758fa21f1b627c551ea476b5d7185f2308f6142b4abe80722600b7
6
+ metadata.gz: c03490dc512a639160a0e1ce82f0ab30b7a609ad423d5031edf3dfd5e8542148f7e7043fe0e3908ce1abfb9c0fa15e4d3c00982834cb218c0af87e054e29e7f9
7
+ data.tar.gz: f90fa1161b5b5d8c73dc75d53b119b2ca2cb32ac4f716f3cf311f134eaa0b942ed776d8680f48d5b21aa44e294e52b110a5f12cabcb86b02792e7fe8a663efb6
@@ -32,3 +32,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
32
32
  ## [0.9.0] - 2018-01-09
33
33
  ### Added
34
34
  - Added arguments on serializable jobs
35
+
36
+ ## [0.10.0] - 2018-01-12
37
+ ### Added
38
+ - Added Serializable Version
39
+ - Added jsonapi_class method at Renderizable, to render versions on controllers
40
+
@@ -10,5 +10,6 @@ require 'json_api_toolbox/paginable'
10
10
  require_relative 'json_api_toolbox/spec_support/shared_examples_for_controllers'
11
11
  require_relative 'json_api_toolbox/serializables/serializable_enum_option'
12
12
  require_relative 'json_api_toolbox/serializables/serializable_job'
13
+ require_relative 'json_api_toolbox/serializables/serializable_version'
13
14
 
14
15
  module JsonApiToolbox; end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module JsonApiToolbox
4
+ module Serializables
5
+ class SerializableVersion < JSONAPI::Serializable::Resource
6
+ type :versions
7
+
8
+ attributes :item_type, :item_id, :event, :whodunnit, :object
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonApiToolbox
4
- VERSION = '0.9.0'
4
+ VERSION = '0.10.0'
5
5
  end
@@ -35,6 +35,15 @@ module JsonApiToolbox
35
35
  params.merge!(includes: model_relationships)
36
36
  end
37
37
 
38
+ def jsonapi_class
39
+ version_hash = {
40
+ 'PaperTrail::Version': JsonApiToolbox::Serializables::
41
+ SerializableVersion
42
+ }
43
+ Hash.new { |h, k| h[k] = "Serializable#{k}".safe_constantize }.
44
+ merge(version_hash)
45
+ end
46
+
38
47
  private
39
48
 
40
49
  def model_name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_api_toolbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adriano Bacha
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-11 00:00:00.000000000 Z
11
+ date: 2018-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -186,6 +186,7 @@ files:
186
186
  - lib/json_api_toolbox/paginable.rb
187
187
  - lib/json_api_toolbox/serializables/serializable_enum_option.rb
188
188
  - lib/json_api_toolbox/serializables/serializable_job.rb
189
+ - lib/json_api_toolbox/serializables/serializable_version.rb
189
190
  - lib/json_api_toolbox/spec_support/shared_examples_for_controllers.rb
190
191
  - lib/json_api_toolbox/version.rb
191
192
  - lib/postable.rb