forest_liana 7.7.1 → 7.7.2
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 255e08fe3efa55b4d3e45bfaefd39c354dcc3d75e4c131516c878250504b53e1
|
4
|
+
data.tar.gz: a933bd8d54b97eb3358d94ee091f43c9962a9b471290f07368e5d01213ab8049
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9c31d5e836eb231b293c61ba924c06d97a32c3b9d53e6bc9c9e70cc1f08a1693d8711fb207e911cb4bea3afa6a887ee90ade10100ad29aa7c55a5d1694476c4
|
7
|
+
data.tar.gz: f44ec6f5110b04548904f438433df70a4f1be6f09d5bd6b448174168a8535ff46b74f649d11233921c482a223be4da36f14e376d416b698120e0a7ee5d13b9c2
|
@@ -369,7 +369,6 @@ module ForestLiana
|
|
369
369
|
|
370
370
|
def attributes(active_record_class)
|
371
371
|
return [] if @is_smart_collection
|
372
|
-
|
373
372
|
active_record_class.column_names.select do |column_name|
|
374
373
|
!association?(active_record_class, column_name)
|
375
374
|
end
|
@@ -410,7 +409,7 @@ module ForestLiana
|
|
410
409
|
|
411
410
|
def foreign_keys(active_record_class)
|
412
411
|
begin
|
413
|
-
SchemaUtils.
|
412
|
+
SchemaUtils.belongs_to_associations(active_record_class).map(&:foreign_key)
|
414
413
|
rescue => err
|
415
414
|
# Association foreign_key triggers an error. Put the stacktrace and
|
416
415
|
# returns no foreign keys.
|
@@ -18,6 +18,12 @@ module ForestLiana
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
+
def self.belongs_to_associations(active_record_class)
|
22
|
+
self.associations(active_record_class).select do |x|
|
23
|
+
[:belongs_to].include?(x.macro)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
21
27
|
def self.many_associations(active_record_class)
|
22
28
|
self.associations(active_record_class).select do |x|
|
23
29
|
[:has_many, :has_and_belongs_to_many].include?(x.macro)
|
data/lib/forest_liana/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_liana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.7.
|
4
|
+
version: 7.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sandro Munda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|