forest_liana 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89becdc8e2eda423a7b72eda18f8454ef9de24e3
4
- data.tar.gz: 591a7461b8d778f65cd32dd32a673fa9bd93285c
3
+ metadata.gz: 5975bb644deb9a1deb05b7f09f8cd868cb773106
4
+ data.tar.gz: b804bb7a0556460a562a6868ffded6db950fae6f
5
5
  SHA512:
6
- metadata.gz: 4a359258970583b04dad690b2f7fa9ac29c4b509a308727d8b56f0304867b5846fdc928ca9534c66a73a3ce69aaeb7699c912ac3e12c3a697ae9488118ccd77d
7
- data.tar.gz: 4bd7383b76c23f05dcf95439ecd9498391ed1c96f5f3984c79cd37035fc51e2f2605cc940685f9b15fc68ee8c924ae2c02104b6ed11b4ae9034a05b5f4375063
6
+ metadata.gz: 6c964bb3bf9be24f4116c13ed3985b8ca3125cf1eff8b2b41c0282141cfd8648b13fb35a41c54cc7315cece54e6ae5f628d85acc5de14a42fa73eaf42f573a10
7
+ data.tar.gz: 5329c9f914afeb1119f0d408020d08cc53325583d4c21a9d737a0a8fcacde4aa8d2741d5ef6011085b6511bae7ef11d5089d9281ce4731d3999d147cbbcc3345
@@ -33,7 +33,11 @@ module ForestLiana
33
33
 
34
34
  query = {}
35
35
  query[@reference_field] = d.customer
36
- d.customer = @reference_model.find_by(query)
36
+ if @reference_model
37
+ d.customer = @reference_model.find_by(query)
38
+ else
39
+ d.customer = nil
40
+ end
37
41
 
38
42
  d
39
43
  end
@@ -52,7 +56,9 @@ module ForestLiana
52
56
  end
53
57
 
54
58
  def reference_model_id
55
- @params["#{@reference_model.table_name.singularize()}Id"]
59
+ if @reference_model
60
+ @params["#{@reference_model.table_name.singularize()}Id"]
61
+ end
56
62
  end
57
63
 
58
64
  def offset
@@ -31,7 +31,11 @@ module ForestLiana
31
31
 
32
32
  query = {}
33
33
  query[@reference_field] = d.customer
34
- d.customer = @reference_model.find_by(query)
34
+ if @reference_model
35
+ d.customer = @reference_model.find_by(query)
36
+ else
37
+ d.customer = nil
38
+ end
35
39
 
36
40
  d
37
41
  end
@@ -50,7 +54,9 @@ module ForestLiana
50
54
  end
51
55
 
52
56
  def reference_model_id
53
- @params["#{@reference_model.table_name.singularize()}Id"]
57
+ if @reference_model
58
+ @params["#{@reference_model.table_name.singularize()}Id"]
59
+ end
54
60
  end
55
61
 
56
62
  def offset
@@ -1 +1,14 @@
1
- Mime::Type.register "application/json", :json, %w( text/x-json application/jsonrequest application/vnd.api+json )
1
+ api_mime_types = %W(
2
+ application/vnd.api+json
3
+ text/x-json
4
+ application/json
5
+ )
6
+
7
+ api_mime_types = %w(
8
+ text/x-json
9
+ application/jsonrequest
10
+ application/vnd.api+json
11
+ )
12
+
13
+ Mime::Type.unregister :json
14
+ Mime::Type.register 'application/json', :json, api_mime_types
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-21 00:00:00.000000000 Z
11
+ date: 2015-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails