jsonapi_compliable 0.4.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +4 -0
- data/Gemfile +2 -2
- data/gemfiles/rails_4.gemfile +4 -3
- data/gemfiles/rails_4.gemfile.lock +27 -36
- data/gemfiles/rails_5.gemfile +4 -3
- data/gemfiles/rails_5.gemfile.lock +27 -37
- data/jsonapi_compliable.gemspec +3 -7
- data/lib/jsonapi_compliable/adapters/abstract.rb +25 -0
- data/lib/jsonapi_compliable/adapters/active_record.rb +47 -0
- data/lib/jsonapi_compliable/adapters/active_record_sideloading.rb +119 -0
- data/lib/jsonapi_compliable/adapters/null.rb +21 -0
- data/lib/jsonapi_compliable/base.rb +43 -50
- data/lib/jsonapi_compliable/deserializable.rb +9 -4
- data/lib/jsonapi_compliable/extensions/extra_attribute.rb +1 -5
- data/lib/jsonapi_compliable/query.rb +153 -0
- data/lib/jsonapi_compliable/rails.rb +14 -0
- data/lib/jsonapi_compliable/resource.rb +191 -0
- data/lib/jsonapi_compliable/scope.rb +57 -0
- data/lib/jsonapi_compliable/{scope → scoping}/base.rb +5 -6
- data/lib/jsonapi_compliable/{scope → scoping}/default_filter.rb +3 -3
- data/lib/jsonapi_compliable/scoping/extra_fields.rb +25 -0
- data/lib/jsonapi_compliable/{scope → scoping}/filter.rb +4 -4
- data/lib/jsonapi_compliable/{scope → scoping}/filterable.rb +4 -4
- data/lib/jsonapi_compliable/{scope → scoping}/paginate.rb +6 -6
- data/lib/jsonapi_compliable/scoping/sort.rb +33 -0
- data/lib/jsonapi_compliable/sideload.rb +95 -0
- data/lib/jsonapi_compliable/stats/dsl.rb +7 -16
- data/lib/jsonapi_compliable/stats/payload.rb +6 -14
- data/lib/jsonapi_compliable/util/field_params.rb +6 -8
- data/lib/jsonapi_compliable/util/hash.rb +14 -0
- data/lib/jsonapi_compliable/util/include_params.rb +7 -18
- data/lib/jsonapi_compliable/util/render_options.rb +25 -0
- data/lib/jsonapi_compliable/version.rb +1 -1
- data/lib/jsonapi_compliable.rb +22 -13
- metadata +34 -70
- data/gemfiles/rails_3.gemfile +0 -9
- data/lib/jsonapi_compliable/dsl.rb +0 -90
- data/lib/jsonapi_compliable/scope/extra_fields.rb +0 -35
- data/lib/jsonapi_compliable/scope/sideload.rb +0 -25
- data/lib/jsonapi_compliable/scope/sort.rb +0 -29
- data/lib/jsonapi_compliable/util/pagination.rb +0 -11
- data/lib/jsonapi_compliable/util/scoping.rb +0 -20
@@ -1,5 +1,5 @@
|
|
1
1
|
module JsonapiCompliable
|
2
|
-
module
|
2
|
+
module Scoping::Filterable
|
3
3
|
def find_filter(name)
|
4
4
|
find_filter!(name)
|
5
5
|
rescue JsonapiCompliable::Errors::BadFilter
|
@@ -8,16 +8,16 @@ module JsonapiCompliable
|
|
8
8
|
|
9
9
|
def find_filter!(name)
|
10
10
|
filter_name, filter_value = \
|
11
|
-
|
11
|
+
resource.filters.find { |_name, opts| opts[:aliases].include?(name.to_sym) }
|
12
12
|
raise JsonapiCompliable::Errors::BadFilter unless filter_name
|
13
13
|
if guard = filter_value[:if]
|
14
|
-
raise JsonapiCompliable::Errors::BadFilter if
|
14
|
+
raise JsonapiCompliable::Errors::BadFilter if resource.context[:object].send(guard) == false
|
15
15
|
end
|
16
16
|
{ filter_name => filter_value }
|
17
17
|
end
|
18
18
|
|
19
19
|
def filter_param
|
20
|
-
|
20
|
+
query_hash[:filter]
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module JsonapiCompliable
|
2
|
-
class
|
2
|
+
class Scoping::Paginate < Scoping::Base
|
3
3
|
MAX_PAGE_SIZE = 1_000
|
4
4
|
|
5
5
|
def apply
|
@@ -12,11 +12,11 @@ module JsonapiCompliable
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def custom_scope
|
15
|
-
|
15
|
+
resource.pagination
|
16
16
|
end
|
17
17
|
|
18
18
|
def apply_standard_scope
|
19
|
-
@scope
|
19
|
+
resource.adapter.paginate(@scope, number, size)
|
20
20
|
end
|
21
21
|
|
22
22
|
def apply_custom_scope
|
@@ -26,15 +26,15 @@ module JsonapiCompliable
|
|
26
26
|
private
|
27
27
|
|
28
28
|
def page_param
|
29
|
-
@page_param ||= (
|
29
|
+
@page_param ||= (query_hash[:page] || {})
|
30
30
|
end
|
31
31
|
|
32
32
|
def number
|
33
|
-
(page_param[:number] ||
|
33
|
+
(page_param[:number] || resource.default_page_number).to_i
|
34
34
|
end
|
35
35
|
|
36
36
|
def size
|
37
|
-
(page_param[:size] ||
|
37
|
+
(page_param[:size] || resource.default_page_size).to_i
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module JsonapiCompliable
|
2
|
+
class Scoping::Sort < Scoping::Base
|
3
|
+
def custom_scope
|
4
|
+
resource.sorting
|
5
|
+
end
|
6
|
+
|
7
|
+
def apply_standard_scope
|
8
|
+
each_sort do |attribute, direction|
|
9
|
+
@scope = resource.adapter.order(@scope, attribute, direction)
|
10
|
+
end
|
11
|
+
@scope
|
12
|
+
end
|
13
|
+
|
14
|
+
def apply_custom_scope
|
15
|
+
each_sort do |attribute, direction|
|
16
|
+
@scope = custom_scope.call(@scope, attribute, direction)
|
17
|
+
end
|
18
|
+
@scope
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def each_sort
|
24
|
+
sort_param.each do |sort_hash|
|
25
|
+
yield sort_hash.keys.first, sort_hash.values.first
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def sort_param
|
30
|
+
@sort_param ||= query_hash[:sort].empty? ? resource.default_sort : query_hash[:sort]
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
module JsonapiCompliable
|
2
|
+
class Sideload
|
3
|
+
attr_reader :name,
|
4
|
+
:resource,
|
5
|
+
:polymorphic,
|
6
|
+
:sideloads,
|
7
|
+
:scope_proc,
|
8
|
+
:assign_proc,
|
9
|
+
:grouper
|
10
|
+
|
11
|
+
def initialize(name, opts)
|
12
|
+
@name = name
|
13
|
+
@resource = (opts[:resource] || Class.new(Resource)).new
|
14
|
+
@sideloads = {}
|
15
|
+
@polymorphic = !!opts[:polymorphic]
|
16
|
+
@polymorphic_groups = {} if polymorphic?
|
17
|
+
|
18
|
+
extend @resource.adapter.sideloading_module
|
19
|
+
end
|
20
|
+
|
21
|
+
def polymorphic?
|
22
|
+
@polymorphic == true
|
23
|
+
end
|
24
|
+
|
25
|
+
def scope(&blk)
|
26
|
+
@scope_proc = blk
|
27
|
+
end
|
28
|
+
|
29
|
+
def assign(&blk)
|
30
|
+
@assign_proc = blk
|
31
|
+
end
|
32
|
+
|
33
|
+
def group_by(&grouper)
|
34
|
+
@grouper = grouper
|
35
|
+
end
|
36
|
+
|
37
|
+
def resolve(parents, query, namespace = nil)
|
38
|
+
namespace ||= name
|
39
|
+
|
40
|
+
if polymorphic?
|
41
|
+
resolve_polymorphic(parents, query)
|
42
|
+
else
|
43
|
+
resolve_basic(parents, query, namespace)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def allow_sideload(name, opts = {}, &blk)
|
48
|
+
sideload = Sideload.new(name, opts)
|
49
|
+
sideload.instance_eval(&blk) if blk
|
50
|
+
|
51
|
+
if polymorphic?
|
52
|
+
@polymorphic_groups[name] = sideload
|
53
|
+
else
|
54
|
+
@sideloads[name] = sideload
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def sideload(name)
|
59
|
+
@sideloads[name]
|
60
|
+
end
|
61
|
+
|
62
|
+
# Grab from nested sideloads, AND resource, recursively
|
63
|
+
def to_hash
|
64
|
+
{ name => {} }.tap do |hash|
|
65
|
+
@sideloads.each_pair do |key, sideload|
|
66
|
+
hash[name][key] = sideload.to_hash[key]
|
67
|
+
|
68
|
+
if sideloading = sideload.resource.sideloading
|
69
|
+
sideloading.sideloads.each_pair do |k, s|
|
70
|
+
hash[name][k] = s.to_hash[k]
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
private
|
78
|
+
|
79
|
+
def resolve_polymorphic(parents, query)
|
80
|
+
parents.group_by(&@grouper).each_pair do |group_type, group_members|
|
81
|
+
sideload_for_group = @polymorphic_groups[group_type]
|
82
|
+
if sideload_for_group
|
83
|
+
sideload_for_group.resolve(group_members, query, name)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def resolve_basic(parents, query, namespace)
|
89
|
+
sideload_scope = scope_proc.call(parents)
|
90
|
+
sideload_scope = Scope.new(sideload_scope, resource, query, namespace: namespace)
|
91
|
+
sideload_results = sideload_scope.resolve
|
92
|
+
assign_proc.call(parents, sideload_results)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -3,19 +3,10 @@ module JsonapiCompliable
|
|
3
3
|
class DSL
|
4
4
|
attr_reader :name, :calculations
|
5
5
|
|
6
|
-
def
|
7
|
-
{
|
8
|
-
count: ->(scope, attr) { scope.count },
|
9
|
-
average: ->(scope, attr) { scope.average(attr).to_f },
|
10
|
-
sum: ->(scope, attr) { scope.sum(attr) },
|
11
|
-
maximum: ->(scope, attr) { scope.maximum(attr) },
|
12
|
-
minimum: ->(scope, attr) { scope.minimum(attr) }
|
13
|
-
}
|
14
|
-
end
|
15
|
-
|
16
|
-
def initialize(config)
|
6
|
+
def initialize(adapter, config)
|
17
7
|
config = { config => [] } if config.is_a?(Symbol)
|
18
8
|
|
9
|
+
@adapter = adapter
|
19
10
|
@calculations = {}
|
20
11
|
@name = config.keys.first
|
21
12
|
Array(config.values.first).each { |c| send(:"#{c}!") }
|
@@ -31,23 +22,23 @@ module JsonapiCompliable
|
|
31
22
|
end
|
32
23
|
|
33
24
|
def count!
|
34
|
-
@calculations[:count] =
|
25
|
+
@calculations[:count] = @adapter.method(:count)
|
35
26
|
end
|
36
27
|
|
37
28
|
def sum!
|
38
|
-
@calculations[:sum] =
|
29
|
+
@calculations[:sum] = @adapter.method(:sum)
|
39
30
|
end
|
40
31
|
|
41
32
|
def average!
|
42
|
-
@calculations[:average] =
|
33
|
+
@calculations[:average] = @adapter.method(:average)
|
43
34
|
end
|
44
35
|
|
45
36
|
def maximum!
|
46
|
-
@calculations[:maximum] =
|
37
|
+
@calculations[:maximum] = @adapter.method(:maximum)
|
47
38
|
end
|
48
39
|
|
49
40
|
def minimum!
|
50
|
-
@calculations[:minimum] =
|
41
|
+
@calculations[:minimum] = @adapter.method(:minimum)
|
51
42
|
end
|
52
43
|
end
|
53
44
|
end
|
@@ -1,18 +1,18 @@
|
|
1
1
|
module JsonapiCompliable
|
2
2
|
module Stats
|
3
3
|
class Payload
|
4
|
-
def initialize(
|
5
|
-
@dsl
|
6
|
-
@
|
7
|
-
@scope
|
4
|
+
def initialize(dsl, query_hash, scope)
|
5
|
+
@dsl = dsl
|
6
|
+
@query_hash = query_hash[:stats]
|
7
|
+
@scope = scope
|
8
8
|
end
|
9
9
|
|
10
10
|
def generate
|
11
11
|
{}.tap do |stats|
|
12
|
-
@
|
12
|
+
@query_hash.each_pair do |name, calculation|
|
13
13
|
stats[name] = {}
|
14
14
|
|
15
|
-
each_calculation(name,
|
15
|
+
each_calculation(name, calculation) do |calc, function|
|
16
16
|
stats[name][calc] = function.call(@scope, name)
|
17
17
|
end
|
18
18
|
end
|
@@ -27,14 +27,6 @@ module JsonapiCompliable
|
|
27
27
|
yield calc, function
|
28
28
|
end
|
29
29
|
end
|
30
|
-
|
31
|
-
def parse_calculation(calculation)
|
32
|
-
if calculation.is_a?(String)
|
33
|
-
calculation.split(',').map(&:to_sym)
|
34
|
-
else
|
35
|
-
calculation.map(&:to_sym)
|
36
|
-
end
|
37
|
-
end
|
38
30
|
end
|
39
31
|
end
|
40
32
|
end
|
@@ -1,17 +1,15 @@
|
|
1
1
|
module JsonapiCompliable
|
2
2
|
module Util
|
3
3
|
class FieldParams
|
4
|
-
def self.parse
|
5
|
-
return
|
4
|
+
def self.parse(params)
|
5
|
+
return {} if params.nil?
|
6
6
|
|
7
|
-
|
8
|
-
params
|
7
|
+
{}.tap do |parsed|
|
8
|
+
params.each_pair do |key, value|
|
9
|
+
parsed[key.to_sym] = value.split(',').map(&:to_sym)
|
10
|
+
end
|
9
11
|
end
|
10
12
|
end
|
11
|
-
|
12
|
-
def self.fieldset(params, name)
|
13
|
-
params[name].to_unsafe_hash.deep_symbolize_keys
|
14
|
-
end
|
15
13
|
end
|
16
14
|
end
|
17
15
|
end
|
@@ -1,28 +1,17 @@
|
|
1
1
|
module JsonapiCompliable
|
2
2
|
module Util
|
3
3
|
class IncludeParams
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
class << self
|
5
|
+
def scrub(requested_includes, allowed_includes)
|
6
|
+
{}.tap do |valid|
|
7
|
+
requested_includes.each_pair do |key, sub_hash|
|
8
|
+
if allowed_includes[key]
|
9
|
+
valid[key] = scrub(sub_hash, allowed_includes[key])
|
10
|
+
end
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
13
|
-
|
14
|
-
def self.scrub(controller)
|
15
|
-
dsl = controller._jsonapi_compliable
|
16
|
-
whitelist = dsl.sideloads[:whitelist] || {}
|
17
|
-
whitelist = whitelist[controller.action_name]
|
18
|
-
includes = JSONAPI::IncludeDirective.new(controller.params[:include])
|
19
|
-
|
20
|
-
if whitelist
|
21
|
-
Util::IncludeParams.compare(includes, whitelist)
|
22
|
-
else
|
23
|
-
{}
|
24
|
-
end
|
25
|
-
end
|
26
15
|
end
|
27
16
|
end
|
28
17
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module JsonapiCompliable
|
2
|
+
module Util
|
3
|
+
class RenderOptions
|
4
|
+
def self.generate(object, query_hash, overrides = {})
|
5
|
+
resolved = object.respond_to?(:resolve) ? object.resolve : object
|
6
|
+
|
7
|
+
options = {}
|
8
|
+
options[:include] = query_hash[:include]
|
9
|
+
options[:jsonapi] = resolved
|
10
|
+
options[:fields] = query_hash[:fields]
|
11
|
+
options.merge!(overrides)
|
12
|
+
options[:meta] ||= {}
|
13
|
+
options[:expose] ||= {}
|
14
|
+
options[:expose][:extra_fields] = query_hash[:extra_fields]
|
15
|
+
|
16
|
+
if object.respond_to?(:resolve_stats)
|
17
|
+
stats = object.resolve_stats
|
18
|
+
options[:meta][:stats] = stats unless stats.empty?
|
19
|
+
end
|
20
|
+
|
21
|
+
options
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/jsonapi_compliable.rb
CHANGED
@@ -1,22 +1,31 @@
|
|
1
|
-
require 'jsonapi/rails'
|
2
|
-
|
3
1
|
require "jsonapi_compliable/version"
|
4
2
|
require "jsonapi_compliable/errors"
|
5
|
-
require "jsonapi_compliable/
|
6
|
-
require "jsonapi_compliable/
|
7
|
-
require "jsonapi_compliable/
|
8
|
-
require "jsonapi_compliable/scope
|
9
|
-
require "jsonapi_compliable/
|
10
|
-
require "jsonapi_compliable/
|
11
|
-
require "jsonapi_compliable/
|
12
|
-
require "jsonapi_compliable/
|
13
|
-
require "jsonapi_compliable/
|
3
|
+
require "jsonapi_compliable/resource"
|
4
|
+
require "jsonapi_compliable/query"
|
5
|
+
require "jsonapi_compliable/sideload"
|
6
|
+
require "jsonapi_compliable/scope"
|
7
|
+
require "jsonapi_compliable/scoping/base"
|
8
|
+
require "jsonapi_compliable/scoping/sort"
|
9
|
+
require "jsonapi_compliable/scoping/paginate"
|
10
|
+
require "jsonapi_compliable/scoping/extra_fields"
|
11
|
+
require "jsonapi_compliable/scoping/filterable"
|
12
|
+
require "jsonapi_compliable/scoping/default_filter"
|
13
|
+
require "jsonapi_compliable/scoping/filter"
|
14
|
+
require "jsonapi_compliable/util/render_options"
|
15
|
+
require "jsonapi_compliable/adapters/abstract"
|
14
16
|
require "jsonapi_compliable/stats/dsl"
|
15
17
|
require "jsonapi_compliable/stats/payload"
|
16
18
|
require "jsonapi_compliable/util/include_params"
|
17
19
|
require "jsonapi_compliable/util/field_params"
|
18
|
-
require "jsonapi_compliable/util/
|
19
|
-
|
20
|
+
require "jsonapi_compliable/util/hash"
|
21
|
+
|
22
|
+
# require correct jsonapi-rb before extensions
|
23
|
+
if defined?(Rails)
|
24
|
+
require 'jsonapi_compliable/rails'
|
25
|
+
else
|
26
|
+
require 'jsonapi/serializable'
|
27
|
+
end
|
28
|
+
|
20
29
|
require "jsonapi_compliable/extensions/extra_attribute"
|
21
30
|
require "jsonapi_compliable/extensions/boolean_attribute"
|
22
31
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi_compliable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
@@ -9,30 +9,10 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-02-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - ">="
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '4.1'
|
21
|
-
- - "<"
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: '6'
|
24
|
-
type: :runtime
|
25
|
-
prerelease: false
|
26
|
-
version_requirements: !ruby/object:Gem::Requirement
|
27
|
-
requirements:
|
28
|
-
- - ">="
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version: '4.1'
|
31
|
-
- - "<"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '6'
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: jsonapi-rails
|
15
|
+
name: jsonapi-serializable
|
36
16
|
requirement: !ruby/object:Gem::Requirement
|
37
17
|
requirements:
|
38
18
|
- - "~>"
|
@@ -46,47 +26,39 @@ dependencies:
|
|
46
26
|
- !ruby/object:Gem::Version
|
47
27
|
version: '0.1'
|
48
28
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
29
|
+
name: activerecord
|
50
30
|
requirement: !ruby/object:Gem::Requirement
|
51
31
|
requirements:
|
52
32
|
- - ">="
|
53
33
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
55
|
-
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: active_model_serializers
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
34
|
+
version: '4.1'
|
35
|
+
- - "<"
|
67
36
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
37
|
+
version: '6'
|
69
38
|
type: :development
|
70
39
|
prerelease: false
|
71
40
|
version_requirements: !ruby/object:Gem::Requirement
|
72
41
|
requirements:
|
73
42
|
- - ">="
|
74
43
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
44
|
+
version: '4.1'
|
45
|
+
- - "<"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '6'
|
76
48
|
- !ruby/object:Gem::Dependency
|
77
|
-
name:
|
49
|
+
name: kaminari
|
78
50
|
requirement: !ruby/object:Gem::Requirement
|
79
51
|
requirements:
|
80
|
-
- - "
|
52
|
+
- - "~>"
|
81
53
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
54
|
+
version: '0.17'
|
83
55
|
type: :development
|
84
56
|
prerelease: false
|
85
57
|
version_requirements: !ruby/object:Gem::Requirement
|
86
58
|
requirements:
|
87
|
-
- - "
|
59
|
+
- - "~>"
|
88
60
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
61
|
+
version: '0.17'
|
90
62
|
- !ruby/object:Gem::Dependency
|
91
63
|
name: bundler
|
92
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,20 +87,6 @@ dependencies:
|
|
115
87
|
- - "~>"
|
116
88
|
- !ruby/object:Gem::Version
|
117
89
|
version: '10.0'
|
118
|
-
- !ruby/object:Gem::Dependency
|
119
|
-
name: rspec-rails
|
120
|
-
requirement: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
-
type: :development
|
126
|
-
prerelease: false
|
127
|
-
version_requirements: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
90
|
- !ruby/object:Gem::Dependency
|
133
91
|
name: sqlite3
|
134
92
|
requirement: !ruby/object:Gem::Requirement
|
@@ -180,33 +138,39 @@ files:
|
|
180
138
|
- bin/console
|
181
139
|
- bin/rspec
|
182
140
|
- bin/setup
|
183
|
-
- gemfiles/rails_3.gemfile
|
184
141
|
- gemfiles/rails_4.gemfile
|
185
142
|
- gemfiles/rails_4.gemfile.lock
|
186
143
|
- gemfiles/rails_5.gemfile
|
187
144
|
- gemfiles/rails_5.gemfile.lock
|
188
145
|
- jsonapi_compliable.gemspec
|
189
146
|
- lib/jsonapi_compliable.rb
|
147
|
+
- lib/jsonapi_compliable/adapters/abstract.rb
|
148
|
+
- lib/jsonapi_compliable/adapters/active_record.rb
|
149
|
+
- lib/jsonapi_compliable/adapters/active_record_sideloading.rb
|
150
|
+
- lib/jsonapi_compliable/adapters/null.rb
|
190
151
|
- lib/jsonapi_compliable/base.rb
|
191
152
|
- lib/jsonapi_compliable/deserializable.rb
|
192
|
-
- lib/jsonapi_compliable/dsl.rb
|
193
153
|
- lib/jsonapi_compliable/errors.rb
|
194
154
|
- lib/jsonapi_compliable/extensions/boolean_attribute.rb
|
195
155
|
- lib/jsonapi_compliable/extensions/extra_attribute.rb
|
196
|
-
- lib/jsonapi_compliable/
|
197
|
-
- lib/jsonapi_compliable/
|
198
|
-
- lib/jsonapi_compliable/
|
199
|
-
- lib/jsonapi_compliable/scope
|
200
|
-
- lib/jsonapi_compliable/
|
201
|
-
- lib/jsonapi_compliable/
|
202
|
-
- lib/jsonapi_compliable/
|
203
|
-
- lib/jsonapi_compliable/
|
156
|
+
- lib/jsonapi_compliable/query.rb
|
157
|
+
- lib/jsonapi_compliable/rails.rb
|
158
|
+
- lib/jsonapi_compliable/resource.rb
|
159
|
+
- lib/jsonapi_compliable/scope.rb
|
160
|
+
- lib/jsonapi_compliable/scoping/base.rb
|
161
|
+
- lib/jsonapi_compliable/scoping/default_filter.rb
|
162
|
+
- lib/jsonapi_compliable/scoping/extra_fields.rb
|
163
|
+
- lib/jsonapi_compliable/scoping/filter.rb
|
164
|
+
- lib/jsonapi_compliable/scoping/filterable.rb
|
165
|
+
- lib/jsonapi_compliable/scoping/paginate.rb
|
166
|
+
- lib/jsonapi_compliable/scoping/sort.rb
|
167
|
+
- lib/jsonapi_compliable/sideload.rb
|
204
168
|
- lib/jsonapi_compliable/stats/dsl.rb
|
205
169
|
- lib/jsonapi_compliable/stats/payload.rb
|
206
170
|
- lib/jsonapi_compliable/util/field_params.rb
|
171
|
+
- lib/jsonapi_compliable/util/hash.rb
|
207
172
|
- lib/jsonapi_compliable/util/include_params.rb
|
208
|
-
- lib/jsonapi_compliable/util/
|
209
|
-
- lib/jsonapi_compliable/util/scoping.rb
|
173
|
+
- lib/jsonapi_compliable/util/render_options.rb
|
210
174
|
- lib/jsonapi_compliable/version.rb
|
211
175
|
homepage:
|
212
176
|
licenses:
|
data/gemfiles/rails_3.gemfile
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "http://artprod.dev.bloomberg.com/artifactory/api/gems/rubygems/"
|
4
|
-
|
5
|
-
gem "appraisal"
|
6
|
-
gem "active_model_serializers", :git => "https://github.com/richmolj/active_model_serializers.git"
|
7
|
-
gem "rails", "~> 3.2"
|
8
|
-
|
9
|
-
gemspec :path => "../"
|