azahara_schema 0.3.1 → 0.3.2
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 +4 -4
- data/lib/azahara_schema/association_attribute.rb +10 -1
- data/lib/azahara_schema/attribute.rb +5 -0
- data/lib/azahara_schema/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbcc60cb930db0856a0b272a556e1e5c26104f3d7d0034b069898cc638271f81
|
4
|
+
data.tar.gz: cbc108bfbf03eec4893f1ccf54ee81193f5482ff3c89f9dffa8a3c7c46d86a62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4221ea1d965bd950d2cd58580a3031581cd8b6d5dc17ed5afc959b32fad061d1fea05b9d9dd2be99144873565710a32e56b71e095d0eebfde2fecdb08e1f0651
|
7
|
+
data.tar.gz: ae2806c220f03f5164a98d1f86e4399060bd11c09643a29c867c9967a01ea9b199378b8f1d976308a6b0626718fba78b34b60bafaec7aea05430b06947f372a7
|
@@ -22,6 +22,11 @@ module AzaharaSchema
|
|
22
22
|
super(model, association.name.to_s+'-'+attribute.name, attribute.type)
|
23
23
|
end
|
24
24
|
|
25
|
+
# Goes to the last level, for attribute base schema
|
26
|
+
def base_schema
|
27
|
+
attribute.try(:schema) || schema
|
28
|
+
end
|
29
|
+
|
25
30
|
def available_values
|
26
31
|
attribute.available_values
|
27
32
|
end
|
@@ -30,12 +35,16 @@ module AzaharaSchema
|
|
30
35
|
attribute.arel_field
|
31
36
|
end
|
32
37
|
|
38
|
+
def primary_key_name
|
39
|
+
association.name.to_s+'-'+attribute.primary_key_name
|
40
|
+
end
|
41
|
+
|
33
42
|
def path
|
34
43
|
association.name.to_s+'.'+attribute.path
|
35
44
|
end
|
36
45
|
|
37
46
|
def column?
|
38
|
-
association.macro == :belongs_to
|
47
|
+
association.macro == :belongs_to && attribute.column?
|
39
48
|
end
|
40
49
|
|
41
50
|
def searchable?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azahara_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ondřej Ezr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|