lolcation_client 0.2.0 → 0.2.1

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: 057c4665dc46558ae6ebcec4b9fe877730b3ed0a
4
- data.tar.gz: fbd6cf5ef7551570fa61f1a39c8f65991160e5fe
3
+ metadata.gz: df9628e7e63bdc1f0b4ad20ab64b0bf457f022a9
4
+ data.tar.gz: 031424944257c515dd069c956359952e329512c6
5
5
  SHA512:
6
- metadata.gz: 114e6203067b0db7ef07d4863e9a4cf9c55dc8382f1fc88055ed2e4fb358dd4b90d4133f76899f66da2d3f869303a229be9054168bf016044c45f40cc7956506
7
- data.tar.gz: 3596bf4e16fa5c488680538870f0abdc514f2b17def7ee6df415c79c2cddee62c2b06b76d83f49275843f01dc2823a94413a2021a9c22c77623f5486708ca41a
6
+ metadata.gz: 9b94eee74830cca296490487be830a3f77739fa3962e3129d4b8feebe6ebb7bbf92f1e44e8bc7fa9fae9a36518cf07173dc148d06dba0e55283b4ec40c332a13
7
+ data.tar.gz: 3e16480fabdf1da152db6e19e2891a36bda214f2baa938716ad989bf37a427ce11bf759522165bfaab4043c6bfa967c4f34ffbf1b99e426cff81fff8b4d2b582
@@ -1,6 +1,9 @@
1
1
  module LolcationClient
2
2
  module Configurations
3
- URL = "https://lolcation-service.loldesign.com.br/api/v1/localizations"
3
+ API = "/api/v1/localizations"
4
+ URL = Rails.env.development?
5
+ ? "http://localhost:8000#{API}"
6
+ : "https://lolcation-service.loldesign.com.br#{API}"
4
7
 
5
8
  def configs
6
9
  Rails.application.config_for(:lolcation)
@@ -7,7 +7,7 @@ module LolcationClient
7
7
 
8
8
  def self.included(model)
9
9
  model.send(:after_validation) do
10
- if self.persisted?
10
+ if self.lolcation_id.present?
11
11
  response = update_on_lolcation_server
12
12
  else
13
13
  response = create_on_lolcation_server
@@ -33,7 +33,7 @@ module LolcationClient
33
33
  self.class.try(:lolcation_custom_fields) || []
34
34
  end
35
35
 
36
- def build_custom_fields
36
+ def build_filter_fields
37
37
  attributes = custom_fields.map {|attribute| {attribute => self.try(attribute)}}
38
38
  hash = {}
39
39
 
@@ -58,7 +58,7 @@ module LolcationClient
58
58
  address_state: self.try(:lolcation_address_state),
59
59
  address_number: self.try(:lolcation_address_number),
60
60
  address_zipcode: self.try(:lolcation_address_zipcode),
61
- #custom_fields: build_custom_fields
61
+ filters: build_filter_fields
62
62
  },
63
63
  sandbox: sandbox?
64
64
  }.to_json
@@ -1,3 +1,3 @@
1
1
  module LolcationClient
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lolcation_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Zaghi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-08-01 00:00:00.000000000 Z
12
+ date: 2017-08-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler