unidom-geo 0.3 → 1.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: 12d31ea61eb003e61fccae0699f67ee7eb690ed5
4
- data.tar.gz: 53df0070bdaff458ac4409f126241400f5547456
3
+ metadata.gz: 6d998808f283dbc60704cadb0a1a08df3708d185
4
+ data.tar.gz: 156ba7447884012df3147844f632e4d9eb6113bc
5
5
  SHA512:
6
- metadata.gz: fb82d867053175160ac9634ff864b2b1ff297cfb947eb69e69c9f45c2892382546960b9a6f487196e10a1fa65e270645bae05dbf05d47be2b2ccd2ccc1423915
7
- data.tar.gz: 6497cce2c3bb2300fb2b2cfab07eb5986b44212b512cfbf4741f7743d1b48f9e2641a4c0504add999456c2d3654f9717f5fb2b91a09d9727bebf4491e50db2dd
6
+ metadata.gz: 6b38e065be0d15e329e1ecd9e82520615004481cc7714d3c79d968ddea8547f1e3579b2914a2136efdcf76b2c4f1ebe7b4291b4213e16ee26efc970f1ee6ac3c
7
+ data.tar.gz: 7f7923875cb11cbbd4786bce9b3b7919b43f03bc18abc1c80ea58607beeb5b8f9d0c91b5d958cdf79be32ad7a69055c19f647f90063dd1f50307c2b78f95d14f
data/README.md CHANGED
@@ -26,5 +26,9 @@ The migration versions start with 200104.
26
26
  Unidom::Geo::Location.valid_at.alive.first.region
27
27
 
28
28
  active_locatings = location.locatings.valid_at.alive
29
- Unidom::Geo::Locating.locate! location, shop
29
+
30
+ # Locate: associate a shop, an estate, or a facility with a location
31
+ location.locate! shop, by: person
32
+ # or
33
+ Unidom::Geo::Locating.locate! location: location, located: shop
30
34
  ```
@@ -14,7 +14,7 @@ class Unidom::Geo::Locating < ActiveRecord::Base
14
14
  scope :located_is, ->(located) { where located: located }
15
15
  scope :located_by, ->(locator) { where locator: locator }
16
16
 
17
- def self.locate!(location, located, locator = nil, opened_at = Time.now)
17
+ def self.locate!(location: nil, located: nil, locator: nil, opened_at: Time.now)
18
18
  attributes = { opened_at: opened_at }
19
19
  if locator.present?
20
20
  attributes[:locator] = locator
@@ -24,4 +24,8 @@ class Unidom::Geo::Location < ActiveRecord::Base
24
24
  scope :region_is, ->(region) { where region: region }
25
25
  scope :postal_address_is, ->(postal_address) { where postal_address: postal_address }
26
26
 
27
+ def locate!(located, by: nil, at: Time.now)
28
+ locatings.create! located: located, locator: by, opened_at: at
29
+ end
30
+
27
31
  end
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Geo
3
- VERSION = '0.3'.freeze
3
+ VERSION = '1.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-geo
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '1.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-21 00:00:00.000000000 Z
11
+ date: 2016-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.9'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.9'
27
27
  description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.