forest_liana 7.6.2 → 7.6.3

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: bf5ae1ded0eccb39f9cd865766053b17ba0887f53109d15d1424b5eb0106fe79
4
- data.tar.gz: af2489f53d749ec12c3c8daeecbca39fd351d71894cd2fafe9dba31b44fcedbc
3
+ metadata.gz: b2c5dee061bff5a6292ee2524d8ec3df10fdd6698960285532cb847c9407412d
4
+ data.tar.gz: 224fc3ad7164a489f3480fe06b153b31a20614a1f4aaf1fc2e66461fa8993218
5
5
  SHA512:
6
- metadata.gz: 3fadc88d411dbf662bf99d836a3790d6ff0d17a5db44fd2ba9153632b1e553202693076609bf0355aba7c9859f27ec82c97e4b6364272a92e17d881c1e7b9ad1
7
- data.tar.gz: 6b202989c5fbb4481c4b86e0911969703a2bbe8f7b4ab1a01874e14b4cb9bb0c33a313eaaeaf0d49958540325ac4f5e031fa7d8e5d0ca8ba6f3acbf7668eefef
6
+ metadata.gz: b0b21988df4803f55f3ef8a72980af8d52d512faddd0189458bc3ab5639e7608fd240da95d0f0a075458a7d855f8b5ff9f81a2b694ef9adf2e29a1c33c373c48
7
+ data.tar.gz: 557a854cee3d809681be1ee96f420266278c3ea2d665f4d4653b574b71ec8a8fa03acf5c6ee4d2c48b031485079d5c3bf0ac39510c31fde228a3d7b18e77dc7f
@@ -8,6 +8,8 @@ module ForestLiana
8
8
  add_columns
9
9
  add_associations
10
10
 
11
+ collection.fields.sort_by! { |k| k[:field].to_s }
12
+
11
13
  # NOTICE: Add ActsAsTaggable fields
12
14
  if @model.try(:taggable?) && @model.respond_to?(:acts_as_taggable) &&
13
15
  @model.acts_as_taggable.respond_to?(:to_a)
@@ -61,7 +61,7 @@ module ForestLiana
61
61
  conditions = []
62
62
 
63
63
  @resource.columns.each_with_index do |column, index|
64
- @fields_searched << column.name if text_type? column.type
64
+ @fields_searched << column.name if text_type?(column.type) || column.type == :uuid
65
65
  column_name = format_column_name(@resource.table_name, column.name)
66
66
  if (@collection.search_fields && !@collection.search_fields.include?(column.name))
67
67
  conditions
@@ -73,6 +73,8 @@ module ForestLiana
73
73
  conditions << "#{@resource.table_name}.id = :search_value_for_uuid"
74
74
  end
75
75
  # NOTICE: Rails 3 do not have a defined_enums method
76
+ elsif REGEX_UUID.match(@search) && column.type == :uuid
77
+ conditions << "#{column_name} = :search_value_for_uuid"
76
78
  elsif @resource.respond_to?(:defined_enums) &&
77
79
  @resource.defined_enums.has_key?(column.name) &&
78
80
  !@resource.defined_enums[column.name][@search.downcase].nil?
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "7.6.2"
2
+ VERSION = "7.6.3"
3
3
  end
@@ -8,7 +8,19 @@ module ForestLiana
8
8
  end
9
9
 
10
10
  expect(collection.fields.map { |field| field[:field] }).to eq(
11
- ["id", "name", "created_at", "updated_at", "trees", "location"]
11
+ ["created_at", "id", "location", "name", "trees", "updated_at"]
12
+ )
13
+ end
14
+ end
15
+
16
+ context 'with standard fields' do
17
+ it 'should be sort by alphabetical order' do
18
+ collection = ForestLiana.apimap.find do |object|
19
+ object.name.to_s == ForestLiana.name_for(Tree)
20
+ end
21
+
22
+ expect(collection.fields.map { |field| field[:field].to_s}).to eq(
23
+ ["age", "created_at", "cutter", "id", "island", "name", "owner", "updated_at"]
12
24
  )
13
25
  end
14
26
  end
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.6.2
4
+ version: 7.6.3
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-05-11 00:00:00.000000000 Z
11
+ date: 2022-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -515,176 +515,176 @@ signing_key:
515
515
  specification_version: 4
516
516
  summary: Official Rails Liana for Forest
517
517
  test_files:
518
- - test/test_helper.rb
519
- - test/fixtures/reference.yml
520
- - test/fixtures/owner.yml
521
- - test/fixtures/tree.yml
522
- - test/fixtures/string_field.yml
523
- - test/fixtures/belongs_to_field.yml
524
- - test/fixtures/has_many_through_field.yml
525
- - test/fixtures/has_many_field.yml
526
- - test/fixtures/serialize_field.yml
527
- - test/fixtures/has_one_field.yml
528
- - test/dummy/bin/rake
529
- - test/dummy/bin/bundle
530
- - test/dummy/bin/rails
531
- - test/dummy/bin/setup
532
- - test/dummy/Rakefile
533
- - test/dummy/config/boot.rb
534
- - test/dummy/config/secrets.yml
535
- - test/dummy/config/application.rb
536
- - test/dummy/config/routes.rb
537
- - test/dummy/config/environments/development.rb
538
- - test/dummy/config/environments/test.rb
539
- - test/dummy/config/environments/production.rb
540
- - test/dummy/config/database.yml
541
- - test/dummy/config/environment.rb
542
- - test/dummy/config/locales/en.yml
543
- - test/dummy/config/initializers/assets.rb
544
- - test/dummy/config/initializers/filter_parameter_logging.rb
545
- - test/dummy/config/initializers/mime_types.rb
546
- - test/dummy/config/initializers/inflections.rb
547
- - test/dummy/config/initializers/cookies_serializer.rb
548
- - test/dummy/config/initializers/backtrace_silencers.rb
549
- - test/dummy/config/initializers/session_store.rb
550
- - test/dummy/config/initializers/wrap_parameters.rb
551
- - test/dummy/README.rdoc
552
- - test/dummy/app/views/layouts/application.html.erb
553
- - test/dummy/app/controllers/application_controller.rb
554
- - test/dummy/app/assets/stylesheets/application.css
555
- - test/dummy/app/assets/config/manifest.js
556
- - test/dummy/app/assets/javascripts/application.js
557
- - test/dummy/app/helpers/application_helper.rb
558
- - test/dummy/app/models/has_many_through_field.rb
559
- - test/dummy/app/models/boolean_field.rb
560
- - test/dummy/app/models/float_field.rb
561
- - test/dummy/app/models/belongs_to_class_name_field.rb
562
- - test/dummy/app/models/has_and_belongs_to_many_field.rb
563
- - test/dummy/app/models/string_field.rb
564
- - test/dummy/app/models/date_field.rb
565
- - test/dummy/app/models/decimal_field.rb
566
- - test/dummy/app/models/tree.rb
567
- - test/dummy/app/models/reference.rb
568
- - test/dummy/app/models/has_many_class_name_field.rb
569
- - test/dummy/app/models/serialize_field.rb
570
- - test/dummy/app/models/owner.rb
571
- - test/dummy/app/models/polymorphic_field.rb
572
- - test/dummy/app/models/integer_field.rb
573
- - test/dummy/app/models/belongs_to_field.rb
574
- - test/dummy/app/models/has_one_field.rb
575
- - test/dummy/app/models/has_many_field.rb
576
- - test/dummy/db/migrate/20150609114636_create_belongs_to_class_name_field.rb
577
- - test/dummy/db/migrate/20150608133038_create_belongs_to_field.rb
518
+ - test/dummy/db/migrate/20150608132159_create_boolean_field.rb
519
+ - test/dummy/db/migrate/20160627172951_create_tree.rb
520
+ - test/dummy/db/migrate/20170614141921_create_serialize_field.rb
578
521
  - test/dummy/db/migrate/20160628173505_add_timestamps.rb
579
- - test/dummy/db/migrate/20150608131603_create_decimal_field.rb
580
- - test/dummy/db/migrate/20181111162121_create_references_table.rb
522
+ - test/dummy/db/migrate/20150609114636_create_belongs_to_class_name_field.rb
581
523
  - test/dummy/db/migrate/20150814081918_create_has_many_through_field.rb
582
- - test/dummy/db/migrate/20150623115554_create_has_many_class_name_field.rb
583
- - test/dummy/db/migrate/20150608150016_create_has_many_field.rb
584
- - test/dummy/db/migrate/20150608131430_create_integer_field.rb
585
- - test/dummy/db/migrate/20160627172810_create_owner.rb
586
524
  - test/dummy/db/migrate/20150608133044_create_has_one_field.rb
587
- - test/dummy/db/migrate/20150616150629_create_polymorphic_field.rb
525
+ - test/dummy/db/migrate/20150608131610_create_float_field.rb
526
+ - test/dummy/db/migrate/20150608131603_create_decimal_field.rb
527
+ - test/dummy/db/migrate/20150608131430_create_integer_field.rb
528
+ - test/dummy/db/migrate/20150608150016_create_has_many_field.rb
588
529
  - test/dummy/db/migrate/20150608132621_create_string_field.rb
589
- - test/dummy/db/migrate/20150608130516_create_date_field.rb
590
- - test/dummy/db/migrate/20160627172951_create_tree.rb
591
- - test/dummy/db/migrate/20170614141921_create_serialize_field.rb
530
+ - test/dummy/db/migrate/20150616150629_create_polymorphic_field.rb
531
+ - test/dummy/db/migrate/20160627172810_create_owner.rb
592
532
  - test/dummy/db/migrate/20150612112520_create_has_and_belongs_to_many_field.rb
593
- - test/dummy/db/migrate/20150608131610_create_float_field.rb
594
- - test/dummy/db/migrate/20150608132159_create_boolean_field.rb
533
+ - test/dummy/db/migrate/20150623115554_create_has_many_class_name_field.rb
534
+ - test/dummy/db/migrate/20150608133038_create_belongs_to_field.rb
535
+ - test/dummy/db/migrate/20150608130516_create_date_field.rb
536
+ - test/dummy/db/migrate/20181111162121_create_references_table.rb
595
537
  - test/dummy/db/schema.rb
596
538
  - test/dummy/public/422.html
597
539
  - test/dummy/public/500.html
598
- - test/dummy/public/favicon.ico
599
540
  - test/dummy/public/404.html
541
+ - test/dummy/public/favicon.ico
542
+ - test/dummy/app/controllers/application_controller.rb
543
+ - test/dummy/app/helpers/application_helper.rb
544
+ - test/dummy/app/views/layouts/application.html.erb
545
+ - test/dummy/app/models/has_many_class_name_field.rb
546
+ - test/dummy/app/models/tree.rb
547
+ - test/dummy/app/models/boolean_field.rb
548
+ - test/dummy/app/models/float_field.rb
549
+ - test/dummy/app/models/has_one_field.rb
550
+ - test/dummy/app/models/has_many_through_field.rb
551
+ - test/dummy/app/models/owner.rb
552
+ - test/dummy/app/models/date_field.rb
553
+ - test/dummy/app/models/has_and_belongs_to_many_field.rb
554
+ - test/dummy/app/models/has_many_field.rb
555
+ - test/dummy/app/models/belongs_to_class_name_field.rb
556
+ - test/dummy/app/models/decimal_field.rb
557
+ - test/dummy/app/models/string_field.rb
558
+ - test/dummy/app/models/belongs_to_field.rb
559
+ - test/dummy/app/models/polymorphic_field.rb
560
+ - test/dummy/app/models/integer_field.rb
561
+ - test/dummy/app/models/reference.rb
562
+ - test/dummy/app/models/serialize_field.rb
563
+ - test/dummy/app/assets/stylesheets/application.css
564
+ - test/dummy/app/assets/config/manifest.js
565
+ - test/dummy/app/assets/javascripts/application.js
600
566
  - test/dummy/config.ru
601
- - test/services/forest_liana/operator_date_interval_parser_test.rb
602
- - test/services/forest_liana/schema_adapter_test.rb
603
- - test/routing/route_test.rb
567
+ - test/dummy/config/environments/production.rb
568
+ - test/dummy/config/environments/test.rb
569
+ - test/dummy/config/environments/development.rb
570
+ - test/dummy/config/environment.rb
571
+ - test/dummy/config/secrets.yml
572
+ - test/dummy/config/routes.rb
573
+ - test/dummy/config/application.rb
574
+ - test/dummy/config/initializers/backtrace_silencers.rb
575
+ - test/dummy/config/initializers/mime_types.rb
576
+ - test/dummy/config/initializers/inflections.rb
577
+ - test/dummy/config/initializers/wrap_parameters.rb
578
+ - test/dummy/config/initializers/cookies_serializer.rb
579
+ - test/dummy/config/initializers/session_store.rb
580
+ - test/dummy/config/initializers/filter_parameter_logging.rb
581
+ - test/dummy/config/initializers/assets.rb
582
+ - test/dummy/config/locales/en.yml
583
+ - test/dummy/config/database.yml
584
+ - test/dummy/config/boot.rb
585
+ - test/dummy/Rakefile
586
+ - test/dummy/bin/bundle
587
+ - test/dummy/bin/rake
588
+ - test/dummy/bin/rails
589
+ - test/dummy/bin/setup
590
+ - test/dummy/README.rdoc
591
+ - test/test_helper.rb
604
592
  - test/forest_liana_test.rb
605
- - spec/spec_helper.rb
606
- - spec/dummy/bin/rake
607
- - spec/dummy/bin/bundle
608
- - spec/dummy/bin/rails
609
- - spec/dummy/bin/setup
610
- - spec/dummy/Rakefile
611
- - spec/dummy/config/boot.rb
612
- - spec/dummy/config/secrets.yml
613
- - spec/dummy/config/application.rb
614
- - spec/dummy/config/routes.rb
615
- - spec/dummy/config/environments/development.rb
616
- - spec/dummy/config/environments/test.rb
617
- - spec/dummy/config/environments/production.rb
618
- - spec/dummy/config/database.yml
619
- - spec/dummy/config/environment.rb
620
- - spec/dummy/config/initializers/assets.rb
621
- - spec/dummy/config/initializers/filter_parameter_logging.rb
622
- - spec/dummy/config/initializers/mime_types.rb
623
- - spec/dummy/config/initializers/inflections.rb
624
- - spec/dummy/config/initializers/forest_liana.rb
625
- - spec/dummy/config/initializers/cookies_serializer.rb
626
- - spec/dummy/config/initializers/backtrace_silencers.rb
627
- - spec/dummy/config/initializers/session_store.rb
628
- - spec/dummy/config/initializers/wrap_parameters.rb
629
- - spec/dummy/README.rdoc
630
- - spec/dummy/app/views/layouts/application.html.erb
631
- - spec/dummy/app/config/routes.rb
593
+ - test/fixtures/has_many_through_field.yml
594
+ - test/fixtures/has_one_field.yml
595
+ - test/fixtures/has_many_field.yml
596
+ - test/fixtures/reference.yml
597
+ - test/fixtures/belongs_to_field.yml
598
+ - test/fixtures/string_field.yml
599
+ - test/fixtures/owner.yml
600
+ - test/fixtures/serialize_field.yml
601
+ - test/fixtures/tree.yml
602
+ - test/routing/route_test.rb
603
+ - test/services/forest_liana/schema_adapter_test.rb
604
+ - test/services/forest_liana/operator_date_interval_parser_test.rb
605
+ - spec/dummy/lib/forest_liana/collections/user.rb
606
+ - spec/dummy/lib/forest_liana/collections/location.rb
607
+ - spec/dummy/lib/forest_liana/collections/island.rb
608
+ - spec/dummy/lib/forest_liana/controllers/owners_controller.rb
609
+ - spec/dummy/lib/forest_liana/controllers/owner_trees_controller.rb
610
+ - spec/dummy/db/migrate/20210526084712_create_products.rb
611
+ - spec/dummy/db/migrate/20190226173051_create_isle.rb
612
+ - spec/dummy/db/migrate/20210326140855_create_locations.rb
613
+ - spec/dummy/db/migrate/20210326110524_create_references.rb
614
+ - spec/dummy/db/migrate/20190716130830_add_age_to_tree.rb
615
+ - spec/dummy/db/migrate/20190226174951_create_tree.rb
616
+ - spec/dummy/db/migrate/20190226172951_create_user.rb
617
+ - spec/dummy/db/migrate/20190716135241_add_type_to_user.rb
618
+ - spec/dummy/db/migrate/20210511141752_create_owners.rb
619
+ - spec/dummy/db/schema.rb
632
620
  - spec/dummy/app/controllers/forest/islands_controller.rb
633
621
  - spec/dummy/app/controllers/application_controller.rb
634
- - spec/dummy/app/assets/stylesheets/application.css
635
- - spec/dummy/app/assets/config/manifest.js
636
- - spec/dummy/app/assets/javascripts/application.js
637
622
  - spec/dummy/app/helpers/application_helper.rb
638
- - spec/dummy/app/models/product.rb
639
- - spec/dummy/app/models/island.rb
623
+ - spec/dummy/app/views/layouts/application.html.erb
640
624
  - spec/dummy/app/models/tree.rb
641
- - spec/dummy/app/models/reference.rb
642
625
  - spec/dummy/app/models/owner.rb
626
+ - spec/dummy/app/models/product.rb
643
627
  - spec/dummy/app/models/user.rb
644
628
  - spec/dummy/app/models/location.rb
645
- - spec/dummy/db/migrate/20210326110524_create_references.rb
646
- - spec/dummy/db/migrate/20190716130830_add_age_to_tree.rb
647
- - spec/dummy/db/migrate/20210326140855_create_locations.rb
648
- - spec/dummy/db/migrate/20190226174951_create_tree.rb
649
- - spec/dummy/db/migrate/20190226173051_create_isle.rb
650
- - spec/dummy/db/migrate/20210526084712_create_products.rb
651
- - spec/dummy/db/migrate/20190226172951_create_user.rb
652
- - spec/dummy/db/migrate/20210511141752_create_owners.rb
653
- - spec/dummy/db/migrate/20190716135241_add_type_to_user.rb
654
- - spec/dummy/db/schema.rb
655
- - spec/dummy/lib/forest_liana/collections/island.rb
656
- - spec/dummy/lib/forest_liana/collections/user.rb
657
- - spec/dummy/lib/forest_liana/collections/location.rb
658
- - spec/dummy/lib/forest_liana/controllers/owners_controller.rb
659
- - spec/dummy/lib/forest_liana/controllers/owner_trees_controller.rb
629
+ - spec/dummy/app/models/island.rb
630
+ - spec/dummy/app/models/reference.rb
631
+ - spec/dummy/app/assets/stylesheets/application.css
632
+ - spec/dummy/app/assets/config/manifest.js
633
+ - spec/dummy/app/assets/javascripts/application.js
634
+ - spec/dummy/app/config/routes.rb
660
635
  - spec/dummy/config.ru
661
- - spec/services/forest_liana/filters_parser_spec.rb
636
+ - spec/dummy/config/environments/production.rb
637
+ - spec/dummy/config/environments/test.rb
638
+ - spec/dummy/config/environments/development.rb
639
+ - spec/dummy/config/environment.rb
640
+ - spec/dummy/config/secrets.yml
641
+ - spec/dummy/config/routes.rb
642
+ - spec/dummy/config/application.rb
643
+ - spec/dummy/config/initializers/backtrace_silencers.rb
644
+ - spec/dummy/config/initializers/mime_types.rb
645
+ - spec/dummy/config/initializers/inflections.rb
646
+ - spec/dummy/config/initializers/wrap_parameters.rb
647
+ - spec/dummy/config/initializers/cookies_serializer.rb
648
+ - spec/dummy/config/initializers/session_store.rb
649
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
650
+ - spec/dummy/config/initializers/assets.rb
651
+ - spec/dummy/config/initializers/forest_liana.rb
652
+ - spec/dummy/config/database.yml
653
+ - spec/dummy/config/boot.rb
654
+ - spec/dummy/Rakefile
655
+ - spec/dummy/bin/bundle
656
+ - spec/dummy/bin/rake
657
+ - spec/dummy/bin/rails
658
+ - spec/dummy/bin/setup
659
+ - spec/dummy/README.rdoc
660
+ - spec/lib/forest_liana/bootstrapper_spec.rb
661
+ - spec/lib/forest_liana/schema_file_updater_spec.rb
662
+ - spec/rails_helper.rb
663
+ - spec/helpers/forest_liana/query_helper_spec.rb
664
+ - spec/helpers/forest_liana/schema_helper_spec.rb
665
+ - spec/requests/test.ru
666
+ - spec/requests/stats_spec.rb
667
+ - spec/requests/cors_spec.rb
668
+ - spec/requests/count_spec.rb
669
+ - spec/requests/actions_controller_spec.rb
670
+ - spec/requests/resources_spec.rb
671
+ - spec/requests/authentications_spec.rb
672
+ - spec/config/initializers/logger_spec.rb
673
+ - spec/services/forest_liana/resources_getter_spec.rb
674
+ - spec/services/forest_liana/schema_adapter_spec.rb
675
+ - spec/services/forest_liana/has_many_getter_spec.rb
662
676
  - spec/services/forest_liana/resource_updater_spec.rb
677
+ - spec/services/forest_liana/line_stat_getter_spec.rb
678
+ - spec/services/forest_liana/permissions_getter_spec.rb
679
+ - spec/services/forest_liana/smart_action_field_validator_spec.rb
680
+ - spec/services/forest_liana/apimap_sorter_spec.rb
663
681
  - spec/services/forest_liana/scope_manager_spec.rb
664
682
  - spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb
665
- - spec/services/forest_liana/apimap_sorter_spec.rb
666
- - spec/services/forest_liana/value_stat_getter_spec.rb
683
+ - spec/services/forest_liana/filters_parser_spec.rb
684
+ - spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb
667
685
  - spec/services/forest_liana/permissions_formatter_spec.rb
668
686
  - spec/services/forest_liana/permissions_checker_live_queries_spec.rb
669
- - spec/services/forest_liana/pie_stat_getter_spec.rb
670
- - spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb
671
687
  - spec/services/forest_liana/ip_whitelist_checker_spec.rb
672
- - spec/services/forest_liana/line_stat_getter_spec.rb
673
- - spec/services/forest_liana/has_many_getter_spec.rb
674
- - spec/services/forest_liana/schema_adapter_spec.rb
675
- - spec/services/forest_liana/smart_action_field_validator_spec.rb
676
- - spec/services/forest_liana/resources_getter_spec.rb
677
- - spec/services/forest_liana/permissions_getter_spec.rb
678
- - spec/requests/resources_spec.rb
679
- - spec/requests/cors_spec.rb
680
- - spec/requests/stats_spec.rb
681
- - spec/requests/authentications_spec.rb
682
- - spec/requests/actions_controller_spec.rb
683
- - spec/requests/test.ru
684
- - spec/requests/count_spec.rb
685
- - spec/config/initializers/logger_spec.rb
686
- - spec/rails_helper.rb
687
- - spec/helpers/forest_liana/schema_helper_spec.rb
688
- - spec/helpers/forest_liana/query_helper_spec.rb
689
- - spec/lib/forest_liana/schema_file_updater_spec.rb
690
- - spec/lib/forest_liana/bootstrapper_spec.rb
688
+ - spec/services/forest_liana/pie_stat_getter_spec.rb
689
+ - spec/services/forest_liana/value_stat_getter_spec.rb
690
+ - spec/spec_helper.rb