unidom-geo 1.3 → 1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/app/models/unidom/geo/concerns/as_locator.rb +2 -8
- data/lib/unidom/geo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef2bfa130c2c1219eced8085052aba3bfa3f1f4e
|
4
|
+
data.tar.gz: 3cfe505c19dba47dea2265a846a27c7fae009fd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35df8578a40282b6557edc4b82d3b1dc8aa096a12087be1cbd3a75ad8cf69a64ec903f5eb48d56eaf481949757c62b2a4ad9183b157e955da5ae294df29fb13e
|
7
|
+
data.tar.gz: eabc82f76daa696d99d87538d5c4ac1a51feab32861310e39dde170f95ca8d563a877ff3509e1a7e2fc9970d18d9ab547ef8165ceffae85135d7b7ac3bce170c
|
data/README.md
CHANGED
@@ -69,6 +69,7 @@ The As Located concern do the following tasks for the includer automatically:
|
|
69
69
|
The As Locator concern do the following tasks for the includer automatically:
|
70
70
|
1. Define the has_many :locatings macro as: ``has_many :locatings, class_name: 'Unidom::Geo::Locating', as: :locator``
|
71
71
|
2. Define the has_many :locations macro as: ``has_many :locations, through: :locatings, source: :location``
|
72
|
+
3. Define the #locate! method as: ``locate!(it, to: nil, at: Time.now)``
|
72
73
|
|
73
74
|
### As Region concern
|
74
75
|
The As Region concern do the following tasks for the includer automatically:
|
@@ -7,16 +7,10 @@ module Unidom::Geo::Concerns::AsLocator
|
|
7
7
|
has_many :locatings, class_name: 'Unidom::Geo::Locating', as: :locator
|
8
8
|
has_many :locations, through: :locatings, source: :location
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
locatings.location_is(to).valid_at(now: at).alive.first_or_create! locator: by, opened_at: at
|
10
|
+
def locate!(it, to: nil, at: Time.now)
|
11
|
+
locatings.location_is(to).located_is(it).valid_at(now: at).alive.first_or_create! opened_at: at
|
13
12
|
end
|
14
13
|
|
15
|
-
def locate?(to: nil, at: Time.now)
|
16
|
-
locatings.location_is(to).valid_at(now: at).alive.exists?
|
17
|
-
end
|
18
|
-
=end
|
19
|
-
|
20
14
|
end
|
21
15
|
|
22
16
|
module ClassMethods
|
data/lib/unidom/geo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-geo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.4'
|
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-
|
11
|
+
date: 2016-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|