forest_liana 6.3.2 → 6.3.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: 9ef103500f1ffd2d8ccf3778c90d54ffcf83348448a0693e5508f73c851ac3d5
4
- data.tar.gz: 825e75b4a37c788382e67eb4a9cc3b487ce18420cb652ba836b5ce6c7430769d
3
+ metadata.gz: 84424699c2834facc9807360cdefbc7de4bf5e473d5d8976fc257c70a5878695
4
+ data.tar.gz: f96a6c6e6ba27fcd42a67ffacd1ddde1133b9980eec177c969494484d2708072
5
5
  SHA512:
6
- metadata.gz: 75b6c515ab034857ef5ab4eb683013466946528fb31df7cb9ad73bdbbdda18df6fdab44ee4cb6ef86e42356600b0988747c816e781cca19082184848b0329731
7
- data.tar.gz: 6790e0e3bbdb01ad881a5914d9e0151e7202b66747a60bfc30cbcebe1e4c39236e4b5423608f78278468b208d8af970214c310b1e90b4109f5e4a49202317c4b
6
+ metadata.gz: 8f509cc0cfed575e60c0b68e11cd44a6bb59c86dfd7bd5e40d14f87f9e2400b4ed7fccafc107e2eea1dbe474f564f9a48d76d84331ca5c9727adae7439176dda
7
+ data.tar.gz: ffdba30b4b5252116c020b42fde6d439baf910d5bcd572c73d5e6bd6c48a6fd39c9803df2300ad0617e61beb4e33bd0edd5c8286eae0a51e348226d187e04be5
@@ -5,7 +5,7 @@ module ForestLiana
5
5
  class AuthenticationController < ForestLiana::BaseController
6
6
  START_AUTHENTICATION_ROUTE = 'authentication'
7
7
  CALLBACK_AUTHENTICATION_ROUTE = 'authentication/callback'
8
- LOGOUT_ROUTE = 'authentication/logout';
8
+ LOGOUT_ROUTE = 'authentication/logout'
9
9
  PUBLIC_ROUTES = [
10
10
  "/#{START_AUTHENTICATION_ROUTE}",
11
11
  "/#{CALLBACK_AUTHENTICATION_ROUTE}",
@@ -53,6 +53,18 @@ module ForestLiana
53
53
  collection.actions.find {|action| action.name == action_name}
54
54
  end
55
55
 
56
+ def generate_action_hooks()
57
+ @collections_sent.each do |collection|
58
+ collection['actions'].each do |action|
59
+ c = get_collection(collection['name'])
60
+ a = get_action(c, action['name'])
61
+ load = !a.hooks.nil? && a.hooks.key?(:load) && a.hooks[:load].is_a?(Proc)
62
+ change = !a.hooks.nil? && a.hooks.key?(:change) && a.hooks[:change].is_a?(Hash) ? a.hooks[:change].keys : []
63
+ action['hooks'] = {:load => load, :change => change}
64
+ end
65
+ end
66
+ end
67
+
56
68
  def generate_apimap
57
69
  create_apimap
58
70
  require_lib_forest_liana
@@ -60,18 +72,8 @@ module ForestLiana
60
72
 
61
73
  if Rails.env.development?
62
74
  @collections_sent = ForestLiana.apimap.as_json
63
-
64
- @collections_sent.each do |collection|
65
- collection['actions'].each do |action|
66
- c = get_collection(collection['name'])
67
- a = get_action(c, action['name'])
68
- load = !a.hooks.nil? && a.hooks.key?(:load) && a.hooks[:load].is_a?(Proc)
69
- change = !a.hooks.nil? && a.hooks.key?(:change) && a.hooks[:change].is_a?(Hash) ? a.hooks[:change].keys : []
70
- action['hooks'] = {:load => load, :change => change}
71
- end
72
- end
73
-
74
75
  @meta_sent = ForestLiana.meta
76
+ generate_action_hooks
75
77
  SchemaFileUpdater.new(SCHEMA_FILENAME, @collections_sent, @meta_sent).perform()
76
78
  else
77
79
  if File.exists?(SCHEMA_FILENAME)
@@ -79,6 +81,7 @@ module ForestLiana
79
81
  content = JSON.parse(File.read(SCHEMA_FILENAME))
80
82
  @collections_sent = content['collections']
81
83
  @meta_sent = content['meta']
84
+ generate_action_hooks
82
85
  rescue JSON::JSONError
83
86
  FOREST_LOGGER.error "The content of .forestadmin-schema.json file is not a correct JSON."
84
87
  FOREST_LOGGER.error "The schema cannot be synchronized with Forest Admin servers."
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "6.3.2"
2
+ VERSION = "6.3.3"
3
3
  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: 6.3.2
4
+ version: 6.3.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: 2021-04-27 00:00:00.000000000 Z
11
+ date: 2021-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -498,161 +498,161 @@ signing_key:
498
498
  specification_version: 4
499
499
  summary: Official Rails Liana for Forest
500
500
  test_files:
501
+ - test/routing/route_test.rb
502
+ - test/fixtures/tree.yml
503
+ - test/fixtures/has_many_field.yml
504
+ - test/fixtures/serialize_field.yml
505
+ - test/fixtures/owner.yml
506
+ - test/fixtures/reference.yml
507
+ - test/fixtures/string_field.yml
508
+ - test/fixtures/belongs_to_field.yml
509
+ - test/fixtures/has_many_through_field.yml
510
+ - test/fixtures/has_one_field.yml
511
+ - test/test_helper.rb
512
+ - test/services/forest_liana/scope_validator_test.rb
501
513
  - test/services/forest_liana/operator_date_interval_parser_test.rb
514
+ - test/services/forest_liana/has_many_getter_test.rb
502
515
  - test/services/forest_liana/schema_adapter_test.rb
516
+ - test/services/forest_liana/pie_stat_getter_test.rb
503
517
  - test/services/forest_liana/value_stat_getter_test.rb
504
518
  - test/services/forest_liana/resource_updater_test.rb
505
- - test/services/forest_liana/scope_validator_test.rb
506
- - test/services/forest_liana/pie_stat_getter_test.rb
507
- - test/services/forest_liana/has_many_getter_test.rb
508
- - test/dummy/README.rdoc
509
- - test/dummy/config/environments/production.rb
510
- - test/dummy/config/environments/development.rb
511
- - test/dummy/config/environments/test.rb
512
- - test/dummy/config/application.rb
513
- - test/dummy/config/secrets.yml
514
- - test/dummy/config/initializers/assets.rb
515
- - test/dummy/config/initializers/wrap_parameters.rb
516
- - test/dummy/config/initializers/session_store.rb
517
- - test/dummy/config/initializers/mime_types.rb
518
- - test/dummy/config/initializers/inflections.rb
519
- - test/dummy/config/initializers/backtrace_silencers.rb
520
- - test/dummy/config/initializers/cookies_serializer.rb
521
- - test/dummy/config/initializers/filter_parameter_logging.rb
522
- - test/dummy/config/boot.rb
523
- - test/dummy/config/database.yml
524
- - test/dummy/config/environment.rb
525
- - test/dummy/config/routes.rb
526
- - test/dummy/config/locales/en.yml
527
- - test/dummy/public/favicon.ico
528
- - test/dummy/public/422.html
529
- - test/dummy/public/404.html
530
- - test/dummy/public/500.html
531
- - test/dummy/Rakefile
519
+ - test/forest_liana_test.rb
520
+ - test/dummy/bin/bundle
521
+ - test/dummy/bin/setup
522
+ - test/dummy/bin/rake
523
+ - test/dummy/bin/rails
532
524
  - test/dummy/config.ru
525
+ - test/dummy/public/500.html
526
+ - test/dummy/public/404.html
527
+ - test/dummy/public/422.html
528
+ - test/dummy/public/favicon.ico
529
+ - test/dummy/app/assets/stylesheets/application.css
530
+ - test/dummy/app/assets/config/manifest.js
531
+ - test/dummy/app/assets/javascripts/application.js
533
532
  - test/dummy/app/helpers/application_helper.rb
534
- - test/dummy/app/models/float_field.rb
533
+ - test/dummy/app/views/layouts/application.html.erb
535
534
  - test/dummy/app/models/has_and_belongs_to_many_field.rb
536
- - test/dummy/app/models/has_one_field.rb
537
- - test/dummy/app/models/serialize_field.rb
535
+ - test/dummy/app/models/decimal_field.rb
538
536
  - test/dummy/app/models/owner.rb
539
- - test/dummy/app/models/integer_field.rb
540
- - test/dummy/app/models/reference.rb
541
- - test/dummy/app/models/has_many_through_field.rb
542
537
  - test/dummy/app/models/boolean_field.rb
543
- - test/dummy/app/models/belongs_to_class_name_field.rb
544
- - test/dummy/app/models/decimal_field.rb
545
- - test/dummy/app/models/belongs_to_field.rb
538
+ - test/dummy/app/models/has_one_field.rb
546
539
  - test/dummy/app/models/has_many_class_name_field.rb
547
- - test/dummy/app/models/tree.rb
540
+ - test/dummy/app/models/has_many_through_field.rb
541
+ - test/dummy/app/models/has_many_field.rb
542
+ - test/dummy/app/models/belongs_to_field.rb
543
+ - test/dummy/app/models/integer_field.rb
544
+ - test/dummy/app/models/belongs_to_class_name_field.rb
548
545
  - test/dummy/app/models/polymorphic_field.rb
549
- - test/dummy/app/models/string_field.rb
546
+ - test/dummy/app/models/serialize_field.rb
547
+ - test/dummy/app/models/tree.rb
548
+ - test/dummy/app/models/float_field.rb
549
+ - test/dummy/app/models/reference.rb
550
550
  - test/dummy/app/models/date_field.rb
551
- - test/dummy/app/models/has_many_field.rb
552
- - test/dummy/app/views/layouts/application.html.erb
551
+ - test/dummy/app/models/string_field.rb
553
552
  - test/dummy/app/controllers/application_controller.rb
554
- - test/dummy/app/assets/config/manifest.js
555
- - test/dummy/app/assets/stylesheets/application.css
556
- - test/dummy/app/assets/javascripts/application.js
553
+ - test/dummy/db/schema.rb
554
+ - test/dummy/db/migrate/20150623115554_create_has_many_class_name_field.rb
555
+ - test/dummy/db/migrate/20150608130516_create_date_field.rb
556
+ - test/dummy/db/migrate/20150612112520_create_has_and_belongs_to_many_field.rb
557
557
  - test/dummy/db/migrate/20150608132621_create_string_field.rb
558
- - test/dummy/db/migrate/20150608133038_create_belongs_to_field.rb
559
- - test/dummy/db/migrate/20150608150016_create_has_many_field.rb
560
558
  - test/dummy/db/migrate/20150616150629_create_polymorphic_field.rb
561
- - test/dummy/db/migrate/20150608131610_create_float_field.rb
562
- - test/dummy/db/migrate/20150623115554_create_has_many_class_name_field.rb
563
- - test/dummy/db/migrate/20181111162121_create_references_table.rb
564
559
  - test/dummy/db/migrate/20150608131430_create_integer_field.rb
565
- - test/dummy/db/migrate/20170614141921_create_serialize_field.rb
566
- - test/dummy/db/migrate/20150612112520_create_has_and_belongs_to_many_field.rb
567
- - test/dummy/db/migrate/20150608131603_create_decimal_field.rb
568
- - test/dummy/db/migrate/20150609114636_create_belongs_to_class_name_field.rb
569
- - test/dummy/db/migrate/20150608133044_create_has_one_field.rb
570
560
  - test/dummy/db/migrate/20160627172951_create_tree.rb
571
- - test/dummy/db/migrate/20150608132159_create_boolean_field.rb
572
- - test/dummy/db/migrate/20150814081918_create_has_many_through_field.rb
573
561
  - test/dummy/db/migrate/20160628173505_add_timestamps.rb
574
- - test/dummy/db/migrate/20150608130516_create_date_field.rb
562
+ - test/dummy/db/migrate/20150608131610_create_float_field.rb
575
563
  - test/dummy/db/migrate/20160627172810_create_owner.rb
576
- - test/dummy/db/schema.rb
577
- - test/dummy/bin/bundle
578
- - test/dummy/bin/setup
579
- - test/dummy/bin/rails
580
- - test/dummy/bin/rake
581
- - test/forest_liana_test.rb
582
- - test/routing/route_test.rb
583
- - test/fixtures/belongs_to_field.yml
584
- - test/fixtures/has_many_through_field.yml
585
- - test/fixtures/owner.yml
586
- - test/fixtures/string_field.yml
587
- - test/fixtures/has_many_field.yml
588
- - test/fixtures/has_one_field.yml
589
- - test/fixtures/serialize_field.yml
590
- - test/fixtures/tree.yml
591
- - test/fixtures/reference.yml
592
- - test/test_helper.rb
593
- - spec/helpers/forest_liana/schema_helper_spec.rb
564
+ - test/dummy/db/migrate/20150814081918_create_has_many_through_field.rb
565
+ - test/dummy/db/migrate/20150608132159_create_boolean_field.rb
566
+ - test/dummy/db/migrate/20170614141921_create_serialize_field.rb
567
+ - test/dummy/db/migrate/20150608150016_create_has_many_field.rb
568
+ - test/dummy/db/migrate/20150608133038_create_belongs_to_field.rb
569
+ - test/dummy/db/migrate/20150608131603_create_decimal_field.rb
570
+ - test/dummy/db/migrate/20181111162121_create_references_table.rb
571
+ - test/dummy/db/migrate/20150608133044_create_has_one_field.rb
572
+ - test/dummy/db/migrate/20150609114636_create_belongs_to_class_name_field.rb
573
+ - test/dummy/README.rdoc
574
+ - test/dummy/Rakefile
575
+ - test/dummy/config/initializers/inflections.rb
576
+ - test/dummy/config/initializers/filter_parameter_logging.rb
577
+ - test/dummy/config/initializers/wrap_parameters.rb
578
+ - test/dummy/config/initializers/mime_types.rb
579
+ - test/dummy/config/initializers/assets.rb
580
+ - test/dummy/config/initializers/backtrace_silencers.rb
581
+ - test/dummy/config/initializers/session_store.rb
582
+ - test/dummy/config/initializers/cookies_serializer.rb
583
+ - test/dummy/config/secrets.yml
584
+ - test/dummy/config/database.yml
585
+ - test/dummy/config/boot.rb
586
+ - test/dummy/config/locales/en.yml
587
+ - test/dummy/config/environment.rb
588
+ - test/dummy/config/application.rb
589
+ - test/dummy/config/environments/production.rb
590
+ - test/dummy/config/environments/development.rb
591
+ - test/dummy/config/environments/test.rb
592
+ - test/dummy/config/routes.rb
593
+ - spec/spec_helper.rb
594
+ - spec/rails_helper.rb
594
595
  - spec/helpers/forest_liana/is_same_data_structure_helper_spec.rb
596
+ - spec/helpers/forest_liana/schema_helper_spec.rb
595
597
  - spec/helpers/forest_liana/query_helper_spec.rb
596
- - spec/requests/resources_spec.rb
597
- - spec/requests/authentications_spec.rb
598
- - spec/requests/stats_spec.rb
599
- - spec/requests/actions_controller_spec.rb
600
- - spec/spec_helper.rb
601
- - spec/services/forest_liana/schema_adapter_spec.rb
598
+ - spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb
599
+ - spec/services/forest_liana/resources_getter_spec.rb
602
600
  - spec/services/forest_liana/filters_parser_spec.rb
603
601
  - spec/services/forest_liana/permissions_getter_spec.rb
604
- - spec/services/forest_liana/permissions_checker_live_queries_spec.rb
605
602
  - spec/services/forest_liana/ip_whitelist_checker_spec.rb
606
- - spec/services/forest_liana/resources_getter_spec.rb
603
+ - spec/services/forest_liana/schema_adapter_spec.rb
604
+ - spec/services/forest_liana/permissions_formatter_spec.rb
605
+ - spec/services/forest_liana/permissions_checker_live_queries_spec.rb
607
606
  - spec/services/forest_liana/apimap_sorter_spec.rb
608
- - spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb
609
607
  - spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb
610
- - spec/services/forest_liana/permissions_formatter_spec.rb
611
- - spec/dummy/README.rdoc
612
- - spec/dummy/config/environments/production.rb
613
- - spec/dummy/config/environments/development.rb
614
- - spec/dummy/config/environments/test.rb
615
- - spec/dummy/config/application.rb
616
- - spec/dummy/config/secrets.yml
617
- - spec/dummy/config/initializers/assets.rb
618
- - spec/dummy/config/initializers/wrap_parameters.rb
619
- - spec/dummy/config/initializers/session_store.rb
620
- - spec/dummy/config/initializers/mime_types.rb
621
- - spec/dummy/config/initializers/inflections.rb
622
- - spec/dummy/config/initializers/backtrace_silencers.rb
623
- - spec/dummy/config/initializers/cookies_serializer.rb
624
- - spec/dummy/config/initializers/forest_liana.rb
625
- - spec/dummy/config/initializers/filter_parameter_logging.rb
626
- - spec/dummy/config/boot.rb
627
- - spec/dummy/config/database.yml
628
- - spec/dummy/config/environment.rb
629
- - spec/dummy/config/routes.rb
630
- - spec/dummy/lib/forest_liana/collections/location.rb
631
- - spec/dummy/lib/forest_liana/collections/user.rb
632
- - spec/dummy/Rakefile
608
+ - spec/requests/actions_controller_spec.rb
609
+ - spec/requests/stats_spec.rb
610
+ - spec/requests/authentications_spec.rb
611
+ - spec/requests/resources_spec.rb
612
+ - spec/dummy/bin/bundle
613
+ - spec/dummy/bin/setup
614
+ - spec/dummy/bin/rake
615
+ - spec/dummy/bin/rails
633
616
  - spec/dummy/config.ru
617
+ - spec/dummy/app/assets/stylesheets/application.css
618
+ - spec/dummy/app/assets/config/manifest.js
619
+ - spec/dummy/app/assets/javascripts/application.js
634
620
  - spec/dummy/app/helpers/application_helper.rb
635
- - spec/dummy/app/models/location.rb
636
- - spec/dummy/app/models/reference.rb
621
+ - spec/dummy/app/views/layouts/application.html.erb
637
622
  - spec/dummy/app/models/user.rb
638
- - spec/dummy/app/models/tree.rb
639
623
  - spec/dummy/app/models/island.rb
624
+ - spec/dummy/app/models/location.rb
625
+ - spec/dummy/app/models/tree.rb
626
+ - spec/dummy/app/models/reference.rb
640
627
  - spec/dummy/app/config/routes.rb
641
- - spec/dummy/app/views/layouts/application.html.erb
642
628
  - spec/dummy/app/controllers/application_controller.rb
643
- - spec/dummy/app/assets/config/manifest.js
644
- - spec/dummy/app/assets/stylesheets/application.css
645
- - spec/dummy/app/assets/javascripts/application.js
629
+ - spec/dummy/db/schema.rb
646
630
  - spec/dummy/db/migrate/20190226174951_create_tree.rb
631
+ - spec/dummy/db/migrate/20210326140855_create_locations.rb
647
632
  - spec/dummy/db/migrate/20190716130830_add_age_to_tree.rb
648
- - spec/dummy/db/migrate/20190226173051_create_isle.rb
633
+ - spec/dummy/db/migrate/20210326110524_create_references.rb
649
634
  - spec/dummy/db/migrate/20190716135241_add_type_to_user.rb
635
+ - spec/dummy/db/migrate/20190226173051_create_isle.rb
650
636
  - spec/dummy/db/migrate/20190226172951_create_user.rb
651
- - spec/dummy/db/migrate/20210326140855_create_locations.rb
652
- - spec/dummy/db/migrate/20210326110524_create_references.rb
653
- - spec/dummy/db/schema.rb
654
- - spec/dummy/bin/bundle
655
- - spec/dummy/bin/setup
656
- - spec/dummy/bin/rails
657
- - spec/dummy/bin/rake
658
- - spec/rails_helper.rb
637
+ - spec/dummy/lib/forest_liana/collections/user.rb
638
+ - spec/dummy/lib/forest_liana/collections/location.rb
639
+ - spec/dummy/README.rdoc
640
+ - spec/dummy/Rakefile
641
+ - spec/dummy/config/initializers/inflections.rb
642
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
643
+ - spec/dummy/config/initializers/wrap_parameters.rb
644
+ - spec/dummy/config/initializers/mime_types.rb
645
+ - spec/dummy/config/initializers/forest_liana.rb
646
+ - spec/dummy/config/initializers/assets.rb
647
+ - spec/dummy/config/initializers/backtrace_silencers.rb
648
+ - spec/dummy/config/initializers/session_store.rb
649
+ - spec/dummy/config/initializers/cookies_serializer.rb
650
+ - spec/dummy/config/secrets.yml
651
+ - spec/dummy/config/database.yml
652
+ - spec/dummy/config/boot.rb
653
+ - spec/dummy/config/environment.rb
654
+ - spec/dummy/config/application.rb
655
+ - spec/dummy/config/environments/production.rb
656
+ - spec/dummy/config/environments/development.rb
657
+ - spec/dummy/config/environments/test.rb
658
+ - spec/dummy/config/routes.rb