forest_liana 8.2.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: aada07cfc20b60dc59e85b49de4b7d719a2f6d8fddcc7a432b36fbfb754a310e
4
- data.tar.gz: bad11ea920e7c0a191f201ad7ba77cb23b54e5a1861b7e2d2d464d23f7885032
3
+ metadata.gz: 0a157aee784201e7da6a7330fc813ce01540107f3c319a6ac294120de809a823
4
+ data.tar.gz: f8343a2641fa23b7eb2934d35a0de7f5e8198e44c961380a0c07a9049671f2ab
5
5
  SHA512:
6
- metadata.gz: d8a2918ef6b5271a11c26e1fb84f6eec5a202eee345ab34412e8669de17fa75ca0a1edeb150cb259e154ea00ffed7e46e552bab7008b5a3bba9dd90b1358287f
7
- data.tar.gz: 4fc0f3ea03ef0a04d63fa2ce633769b939b67892988becb3884e8109dfbbff0ef8fd6a8ff1dbc185a58d91ab61c85cb30b06cf0e96e18cbfb69131f7da1c0699
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
- 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,6 +1,6 @@
1
1
  module ForestLiana
2
2
  class SearchQueryBuilder
3
- REGEX_UUID = /\A[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\z/i
3
+ REGEX_UUID = /\A[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\z/i
4
4
 
5
5
  attr_reader :fields_searched
6
6
 
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "8.2.0"
2
+ VERSION = "9.0.0.beta.1"
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.2.0
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-29 00:00:00.000000000 Z
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: '0'
547
+ version: 1.3.1
548
548
  requirements: []
549
549
  rubygems_version: 3.3.5
550
550
  signing_key: