unidom-category 1.6.7 → 1.6.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a957f78833da7dbe6e46169e05c61dd0dd8b9f04
|
4
|
+
data.tar.gz: 36e58beed05badb7d7b8bc9df80f0e6671054b31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0fa5b22cf5cc2609aef6d2b94b9fc49c33cab4b5cd2ac73bdefdc0229c79bb35dc71e71df74847cabc3d21697a0ce0a8640dae4be35e70b3bf203c2a1e64fde
|
7
|
+
data.tar.gz: c216c2cf042979b2b7fc99c242df9451c80fcda55f0ca0ae082e08761d973600842771fa956094db4161e4d939c67a8213f6db6a6c6e85e97b66015dd7a3a064
|
@@ -34,9 +34,9 @@ class Unidom::Category::CategoryRollup < Unidom::Category::ApplicationRecord
|
|
34
34
|
# Unidom::Category::CategoryRollup.roll_up! moto, into: vehicle
|
35
35
|
def self.roll_up!(it, into: nil, at: Time.now)
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
assert_present! :it, it
|
38
|
+
assert_present! :into, into
|
39
|
+
assert_present! :at, at
|
40
40
|
|
41
41
|
self.descendant_category_is(it).ancestor_category_is(into).valid_at(now: at).alive.first_or_create! opened_at: at
|
42
42
|
|
@@ -28,10 +28,10 @@ describe Unidom::Category::CategoryRollup, type: :model do
|
|
28
28
|
it_behaves_like 'monomorphic scope', model_attributes, :ancestor_category_is, :ancestor_category
|
29
29
|
it_behaves_like 'monomorphic scope', model_attributes, :descendant_category_is, :descendant_category
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
it = Unidom::Category::Category.create! category_attributes.merge(code: 'ZC', name: 'Sub Category', abbreviation: 'SubCat')
|
32
|
+
into = Unidom::Category::Category.create! category_attributes.merge(code: 'YC')
|
33
33
|
|
34
|
-
|
34
|
+
it_behaves_like 'assert_present!', described_class, :roll_up!, [ it, { into: into, at: Time.now } ], [ { 0 => :it }, :into, :at ]
|
35
35
|
|
36
36
|
end
|
37
37
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-category
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|