forest_liana 8.1.0 → 9.0.0.beta.1
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: 0a157aee784201e7da6a7330fc813ce01540107f3c319a6ac294120de809a823
|
4
|
+
data.tar.gz: f8343a2641fa23b7eb2934d35a0de7f5e8198e44c961380a0c07a9049671f2ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6057484cb179b3ae0203f935df4638cd080c4777807cfcc4758a4dd2bbfc9ca4627cd1a7b85b487a469f2e9a66f31a9ce9f58e7fdd474e5de552516780c57be2
|
7
|
+
data.tar.gz: 6bb712c6471e7cbe7016582b3a10fe34159cf46b12b8c1626ca706fb95f2d91e585ee4dd8592a1efcf8afd91e287def131777f35c2d028903fa502a4007cd546
|
@@ -242,8 +242,6 @@ module ForestLiana
|
|
242
242
|
SchemaUtils.associations(@model).each do |association|
|
243
243
|
begin
|
244
244
|
if SchemaUtils.polymorphic?(association) &&
|
245
|
-
(ENV['ENABLE_SUPPORT_POLYMORPHISM'].present? && ENV['ENABLE_SUPPORT_POLYMORPHISM'].downcase == 'true')
|
246
|
-
|
247
245
|
collection.fields << {
|
248
246
|
field: association.name.to_s,
|
249
247
|
type: get_type_for_association(association),
|
@@ -4,12 +4,7 @@ module ForestLiana
|
|
4
4
|
def self.associations(active_record_class)
|
5
5
|
active_record_class.reflect_on_all_associations.select do |association|
|
6
6
|
begin
|
7
|
-
|
8
|
-
polymorphic?(association) ? true : !is_active_type?(association.klass)
|
9
|
-
else
|
10
|
-
!polymorphic?(association) && !is_active_type?(association.klass)
|
11
|
-
end
|
12
|
-
|
7
|
+
polymorphic?(association) ? true : !is_active_type?(association.klass)
|
13
8
|
rescue
|
14
9
|
FOREST_LOGGER.warn "Unknown association #{association.name} on class #{active_record_class.name}"
|
15
10
|
false
|
data/lib/forest_liana/version.rb
CHANGED
@@ -40,23 +40,6 @@ module ForestLiana
|
|
40
40
|
|
41
41
|
expect(removed_fields).to be_empty
|
42
42
|
end
|
43
|
-
|
44
|
-
context 'when the polymorphic support was disabled' do
|
45
|
-
it 'should not define the association' do
|
46
|
-
ENV['ENABLE_SUPPORT_POLYMORPHISM'] = 'false'
|
47
|
-
Bootstrapper.new(true)
|
48
|
-
collection = ForestLiana.apimap.find do |object|
|
49
|
-
object.name.to_s == ForestLiana.name_for(Address)
|
50
|
-
end
|
51
|
-
association = collection.fields.find { |field| field[:field] == 'addressable' }
|
52
|
-
fields = collection.fields.select do |field|
|
53
|
-
field[:field] == 'addressable_id' || field[:field] == 'addressable_type'
|
54
|
-
end
|
55
|
-
|
56
|
-
expect(association).to be_nil
|
57
|
-
expect(fields.size).to eq(2)
|
58
|
-
end
|
59
|
-
end
|
60
43
|
end
|
61
44
|
|
62
45
|
context 'with an "unhandled" column types (binary, postgis geography, ...)' do
|
data/spec/spec_helper.rb
CHANGED
@@ -19,7 +19,6 @@ SimpleCov.add_filter ['app/services/forest_liana/ability/fetch.rb', 'lib/forest_
|
|
19
19
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
20
20
|
RSpec.configure do |config|
|
21
21
|
ENV['RAILS_ENV'] = 'test'
|
22
|
-
ENV['ENABLE_SUPPORT_POLYMORPHISM'] = 'true'
|
23
22
|
|
24
23
|
require File.expand_path('../dummy/config/environment', __FILE__)
|
25
24
|
|
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:
|
4
|
+
version: 9.0.0.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sandro Munda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -542,9 +542,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
542
542
|
version: '0'
|
543
543
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
544
544
|
requirements:
|
545
|
-
- - "
|
545
|
+
- - ">"
|
546
546
|
- !ruby/object:Gem::Version
|
547
|
-
version:
|
547
|
+
version: 1.3.1
|
548
548
|
requirements: []
|
549
549
|
rubygems_version: 3.3.5
|
550
550
|
signing_key:
|