lolcation_client 0.2.5 → 0.2.6

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: aaabef2659a029727380152f544427ac295930bf
4
- data.tar.gz: 529d4879eb85ac16c6befa19c15cde6a7f4161e5
3
+ metadata.gz: 7c72f2ff31f2b0c3194da1a52350e269cde8f0c8
4
+ data.tar.gz: dceb1c67143dd30e20424061bfb08e5ac50b3666
5
5
  SHA512:
6
- metadata.gz: d8e36ad761ebf8ac0e1e6f80e4731ee8db92946ee915347d5ecf77daea57fa2c3cbe3ae5c7c94a8a315a6ba95b89057f4e9439e73fc2fb114be65a5ce2f1953d
7
- data.tar.gz: 1e5f4157aa5f7bea0f74eda4643ec4864edd896566fcf283c7c28240455099781b4b87616c09011b23e0e4d8d204818088e88304537ab36aa4428cdebb0d0eee
6
+ metadata.gz: 89e713c5c201d2151849c52477c3654a566d53f94eaa492c26c02b241c529728a140af4cb2313c2736ce64fcce7637a496e636a595198d94f7d62f829bdebadb
7
+ data.tar.gz: dce53205b5a06d65b909aa5f5cd756ec26e2791b5d2a3215019fafa7d9b38fc268e89b694983ecff846b6612106a2fba6929256d08660b733b1e9bf5cf5e3af2
@@ -7,6 +7,21 @@ module LolcationClient
7
7
 
8
8
  def self.included(model)
9
9
  model.send(:after_validation) do
10
+ self.errors.add("lolcation_name", :blank) unless self.lolcation_name.present?
11
+
12
+ if self.lolcation_address_street.present?
13
+ self.errors.add("lolcation_address_neighborhood", :blank) unless self.lolcation_address_neighborhood.present?
14
+ self.errors.add("lolcation_address_city" , :blank) unless self.lolcation_address_city.present?
15
+ self.errors.add("lolcation_address_state" , :blank) unless self.lolcation_address_state.present?
16
+ self.errors.add("lolcation_address_number" , :blank) unless self.lolcation_address_number.present?
17
+ self.errors.add("lolcation_address_zipcode" , :blank) unless self.lolcation_address_zipcode.present?
18
+ else
19
+ self.errors.add("lolcation_latitude" , :blank) unless self.lolcation_latitude.present?
20
+ self.errors.add("lolcation_longitude", :blank) unless self.lolcation_longitude.present?
21
+ end
22
+ end
23
+
24
+ model.send(:after_save) do
10
25
  if self.lolcation_id.present?
11
26
  response = update_on_lolcation_server
12
27
  else
@@ -7,6 +7,7 @@ module LolcationClient
7
7
 
8
8
  def near_in(options = {})
9
9
  raise ArgumentError, 'Latitude and Longitude is required' unless options[:latitude].present? || options[:longitude].present?
10
+ raise ArgumentError, 'Distance must be grater than 0' if options[:distance] =~ /\A0/
10
11
 
11
12
  process(do_post(options.merge(sandbox: sandbox?)), options)
12
13
  end
@@ -1,3 +1,3 @@
1
1
  module LolcationClient
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
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.5
4
+ version: 0.2.6
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-28 00:00:00.000000000 Z
12
+ date: 2017-09-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler