forest_liana 8.1.0 → 9.0.0

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: e051d1446dd0f16749a9d078bb0caee6ff1b93c37557b5fdc0571fca710137f8
4
- data.tar.gz: 90db1924c8d20ef02b3525eb84bba26ed03025fe042b4c6405d83ebaf3ac2e23
3
+ metadata.gz: f689a34911a00dc2ef7b97399ec1cfa9ddb8c23307ab4b352e4d016a2d96db95
4
+ data.tar.gz: 38c60de7761a88c21ee4a07174112edcbab77438a25a93a3376fe1a0d4f94bb9
5
5
  SHA512:
6
- metadata.gz: 87d40012a5f767ebc6faf75c5cb9826d50afc536837daad7f578f85ecf8b6e4c82f20d2c4eb246a4a3197e7e8d0ef6ad294362dccd5100b1194ce3897fda8044
7
- data.tar.gz: 3d24e8527ae65ec0945ebd309a4958257ee4b12792d78f41e72427baea073333f4630756dc48254fef347ad467976a5bddeddf85d823432c94f34a4f8e465eb5
6
+ metadata.gz: a2f6f5895ac0c382c4f9f931df1ba45b543514a8f48533945232c04d5d446c86493cb31bbecf920f689f88af338e56d5452c9b4ea8ce14ffbd6b87947ffd78d8
7
+ data.tar.gz: 3bdfbd9addebde69b38b890c17d0a6c6939c6a4b19a3bb64e128af50207099168d5c901c55f48f90eb19ceb91c4b6f6f5d2e1eab45a43ecfb95203f77312262d
@@ -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
- if (ENV['ENABLE_SUPPORT_POLYMORPHISM'].present? && ENV['ENABLE_SUPPORT_POLYMORPHISM'].downcase == 'true')
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
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "8.1.0"
2
+ VERSION = "9.0.0"
3
3
  end
@@ -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: 8.1.0
4
+ version: 9.0.0
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-18 00:00:00.000000000 Z
11
+ date: 2024-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails