iron_admin 0.4.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +66 -30
- data/app/assets/config/iron_admin_manifest.js +12 -0
- data/app/components/iron_admin/dashboards/metric_card_component.html.haml +8 -3
- data/app/components/iron_admin/dashboards/metric_card_component.rb +21 -1
- data/app/components/iron_admin/form/belongs_to_component.rb +60 -6
- data/app/components/iron_admin/form/nested_form_component.html.haml +28 -0
- data/app/components/iron_admin/form/nested_form_component.rb +81 -0
- data/app/components/iron_admin/resources/data_table_component.html.haml +1 -1
- data/app/components/iron_admin/resources/data_table_component.rb +6 -0
- data/app/components/iron_admin/resources/show_field_component.rb +2 -0
- data/app/controllers/iron_admin/application_controller.rb +32 -1
- data/app/controllers/iron_admin/concerns/action_executable.rb +44 -0
- data/app/controllers/iron_admin/concerns/filterable.rb +84 -0
- data/app/controllers/iron_admin/concerns/json_params_coercion.rb +67 -0
- data/app/controllers/iron_admin/concerns/nested_permittable.rb +36 -0
- data/app/controllers/iron_admin/concerns/scopeable.rb +84 -0
- data/app/controllers/iron_admin/concerns/searchable.rb +13 -16
- data/app/controllers/iron_admin/exports_controller.rb +15 -11
- data/app/controllers/iron_admin/imports_controller.rb +83 -0
- data/app/controllers/iron_admin/live_controller.rb +12 -0
- data/app/controllers/iron_admin/resources_controller.rb +118 -117
- data/app/controllers/iron_admin/search_controller.rb +5 -5
- data/app/controllers/iron_admin/tools_controller.rb +63 -4
- data/app/helpers/iron_admin/application_helper.rb +33 -14
- data/app/helpers/iron_admin/field_display_helper.rb +160 -1
- data/app/javascript/iron_admin/controllers/cp_nested_form_controller.js +113 -0
- data/app/javascript/iron_admin/controllers/filter_operator_controller.js +10 -0
- data/app/javascript/iron_admin/index.js +4 -0
- data/app/views/iron_admin/dashboard/index.html.haml +7 -2
- data/app/views/iron_admin/form/_nested_row.html.haml +70 -0
- data/app/views/iron_admin/imports/new.html.haml +27 -0
- data/app/views/iron_admin/imports/preview.html.haml +31 -0
- data/app/views/iron_admin/resources/_form.html.haml +81 -5
- data/app/views/iron_admin/resources/action_form.html.haml +62 -0
- data/app/views/iron_admin/resources/bulk_action_form.html.haml +62 -0
- data/app/views/iron_admin/resources/index.html.haml +60 -18
- data/app/views/iron_admin/tools/action_form.html.haml +57 -0
- data/app/views/iron_admin/tools/show.html.haml +20 -1
- data/config/importmap.rb +2 -0
- data/config/locales/en.yml +36 -0
- data/config/routes.rb +7 -0
- data/docs/components/filter-components.md +60 -0
- data/docs/getting-started/installation.md +113 -27
- data/docs/getting-started/quick-start.md +17 -1
- data/docs/guides/authentication.md +7 -6
- data/docs/guides/custom-adapters.md +628 -0
- data/docs/guides/extending.md +132 -3
- data/docs/guides/fields.md +1 -1
- data/docs/guides/resources.md +78 -2
- data/docs/guides/troubleshooting.md +68 -10
- data/docs/reference/routes.md +10 -0
- data/lib/generators/iron_admin/install/install_generator.rb +49 -4
- data/lib/generators/iron_admin/install/templates/dashboard.rb.tt +5 -1
- data/lib/generators/iron_admin/install_audit/install_audit_generator.rb +26 -10
- data/lib/generators/iron_admin/resource/resource_generator.rb +1 -1
- data/lib/generators/iron_admin/resource/templates/resource.rb.tt +6 -2
- data/lib/iron_admin/action_field.rb +56 -0
- data/lib/iron_admin/adapters/active_record.rb +237 -0
- data/lib/iron_admin/adapters/base.rb +340 -0
- data/lib/iron_admin/adapters/http/column_descriptor.rb +10 -0
- data/lib/iron_admin/adapters/http/configuration.rb +27 -0
- data/lib/iron_admin/adapters/http/connection.rb +117 -0
- data/lib/iron_admin/adapters/http/model_proxy.rb +75 -0
- data/lib/iron_admin/adapters/http/query.rb +111 -0
- data/lib/iron_admin/adapters/http/record.rb +83 -0
- data/lib/iron_admin/adapters/http/type_inferrer.rb +51 -0
- data/lib/iron_admin/adapters/http.rb +241 -0
- data/lib/iron_admin/adapters/mongoid/association_wrapper.rb +74 -0
- data/lib/iron_admin/adapters/mongoid/column_descriptor.rb +10 -0
- data/lib/iron_admin/adapters/mongoid.rb +284 -0
- data/lib/iron_admin/adapters/registry.rb +44 -0
- data/lib/iron_admin/concerns/importable.rb +81 -0
- data/lib/iron_admin/concerns/live_updatable.rb +38 -0
- data/lib/iron_admin/concerns/nestable.rb +69 -0
- data/lib/iron_admin/concerns/soft_deletable.rb +61 -0
- data/lib/iron_admin/configuration.rb +20 -0
- data/lib/iron_admin/dashboard.rb +15 -20
- data/lib/iron_admin/engine.rb +35 -22
- data/lib/iron_admin/errors.rb +29 -0
- data/lib/iron_admin/field_inferrer.rb +61 -22
- data/lib/iron_admin/filters/active_record_query_builder.rb +63 -0
- data/lib/iron_admin/filters/base_query_builder.rb +55 -0
- data/lib/iron_admin/filters/http_query_builder.rb +39 -0
- data/lib/iron_admin/filters/mongoid_query_builder.rb +58 -0
- data/lib/iron_admin/filters/query_builder.rb +12 -0
- data/lib/iron_admin/import/column_mapper.rb +42 -0
- data/lib/iron_admin/import/import_preview.rb +10 -0
- data/lib/iron_admin/import/import_result.rb +10 -0
- data/lib/iron_admin/import/importer.rb +231 -0
- data/lib/iron_admin/import/parser/csv.rb +34 -0
- data/lib/iron_admin/import/parser/json.rb +36 -0
- data/lib/iron_admin/import/type_caster.rb +47 -0
- data/lib/iron_admin/live/broadcaster.rb +43 -0
- data/lib/iron_admin/live/poll_cache.rb +28 -0
- data/lib/iron_admin/live.rb +29 -0
- data/lib/iron_admin/nested_association.rb +15 -0
- data/lib/iron_admin/nested_attributes_validator.rb +25 -0
- data/lib/iron_admin/policy.rb +72 -13
- data/lib/iron_admin/resource.rb +149 -91
- data/lib/iron_admin/resource_registry.rb +77 -4
- data/lib/iron_admin/tool.rb +50 -0
- data/lib/iron_admin/tool_action.rb +73 -0
- data/lib/iron_admin/tool_context.rb +49 -0
- data/lib/iron_admin/version.rb +1 -1
- data/lib/iron_admin.rb +46 -10
- data/vendor/bundle/ruby/3.2.0/cache/addressable-2.9.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/crack-1.0.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/faraday-2.14.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/faraday-net_http-3.4.2.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/hashdiff-1.2.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/net-http-0.9.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/public_suffix-7.0.5.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/rexml-3.4.4.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/webmock-3.26.2.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/bigdecimal.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/mkmf.log +25 -25
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/date_core.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/mkmf.log +4 -4
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/erb/escape.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/mkmf.log +2 -2
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/mkmf.log +22 -22
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/mkmf.log +9 -9
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/mkmf.log +12 -12
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/nio4r_ext.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/mkmf.log +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/prism/prism.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/mkmf.log +7 -7
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/racc/cparse.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/redcarpet-3.6.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/redcarpet-3.6.1/redcarpet.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/mkmf.log +2 -2
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/stringio.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/websocket-driver-0.8.0/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/websocket-driver-0.8.0/websocket_mask.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/CHANGELOG.md +326 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/LICENSE.txt +202 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/README.md +121 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna/native.rb +66 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna/pure.rb +4710 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna.rb +26 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/template.rb +1040 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/uri.rb +2602 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/version.rb +31 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable.rb +4 -0
- data/vendor/bundle/ruby/3.2.0/gems/bigdecimal-4.0.1/ext/bigdecimal/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/bigdecimal-4.0.1/lib/bigdecimal.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/History +58 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/LICENSE +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/README.md +43 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/json.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/util.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/version.rb +3 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/xml.rb +240 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack.rb +8 -0
- data/vendor/bundle/ruby/3.2.0/gems/date-3.5.1/ext/date/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/date-3.5.1/lib/date_core.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/erb-6.0.1/ext/erb/escape/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/erb-6.0.1/lib/erb/escape.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/CHANGELOG.md +574 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/README.md +67 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/Rakefile +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/examples/client_spec.rb +119 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/examples/client_test.rb +144 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter/test.rb +311 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter.rb +101 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter_registry.rb +30 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/connection.rb +565 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/encoders/flat_params_encoder.rb +105 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/encoders/nested_params_encoder.rb +183 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/error.rb +202 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/logging/formatter.rb +118 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/methods.rb +6 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/middleware.rb +72 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/middleware_registry.rb +83 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/connection_options.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/env.rb +204 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/proxy_options.rb +38 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/request_options.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/ssl_options.rb +76 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options.rb +219 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/parameters.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/rack_builder.rb +248 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/authorization.rb +54 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/instrumentation.rb +58 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/json.rb +70 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/url_encoded.rb +60 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request.rb +139 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/json.rb +74 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/logger.rb +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/raise_error.rb +83 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response.rb +95 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils/headers.rb +150 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils/params_hash.rb +61 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils.rb +121 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/version.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday.rb +158 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/external_adapters/faraday_specs_setup.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter/test_spec.rb +442 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter_registry_spec.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter_spec.rb +55 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/connection_spec.rb +841 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/error_spec.rb +175 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/middleware_registry_spec.rb +31 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/middleware_spec.rb +213 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/env_spec.rb +76 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/options_spec.rb +297 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/proxy_options_spec.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/request_options_spec.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/params_encoders/flat_spec.rb +42 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/params_encoders/nested_spec.rb +151 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/rack_builder_spec.rb +317 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/authorization_spec.rb +118 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/instrumentation_spec.rb +74 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/json_spec.rb +199 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/url_encoded_spec.rb +93 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request_spec.rb +110 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/json_spec.rb +206 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/logger_spec.rb +299 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/raise_error_spec.rb +286 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response_spec.rb +84 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/utils/headers_spec.rb +109 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/utils_spec.rb +120 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday_spec.rb +43 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/spec_helper.rb +133 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/disabling_stub.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/fake_safe_buffer.rb +15 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/faraday_middleware_subclasses.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/helper_methods.rb +96 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/adapter.rb +105 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/params_encoder.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/request_method.rb +263 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/streaming_response_checker.rb +35 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/LICENSE.md +21 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/README.md +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/adapter/net_http.rb +206 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/net_http/version.rb +7 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/net_http.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/Gemfile +8 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/LICENSE +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/README.md +323 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/Rakefile +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/changelog.md +127 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/hashdiff.gemspec +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/compare_hashes.rb +101 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/diff.rb +185 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/lcs.rb +66 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/lcs_compare_arrays.rb +32 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/linear_compare_array.rb +159 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/patch.rb +88 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/util.rb +155 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/version.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.8.2/ext/io/console/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.8.2/lib/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/ext/json/ext/generator/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/ext/json/ext/parser/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/lib/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/lib/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/BSDL +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/COPYING +56 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/README.md +93 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/doc/net-http/examples.rdoc +31 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/doc/net-http/included_getters.rdoc +3 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/exceptions.rb +35 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/generic_request.rb +429 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/header.rb +985 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/proxy_delta.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/request.rb +88 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/requests.rb +444 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/response.rb +739 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/responses.rb +1242 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/status.rb +84 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http.rb +2608 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/https.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/nio4r-2.7.5/ext/nio4r/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/nio4r-2.7.5/lib/nio4r_ext.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/prism-1.9.0/ext/prism/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/prism-1.9.0/lib/prism/prism.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/psych-5.3.1/ext/psych/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/psych-5.3.1/lib/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/CHANGELOG.md +649 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/Gemfile +16 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/README.md +231 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/SECURITY.md +24 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/data/list.txt +16298 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/domain.rb +235 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/errors.rb +41 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/list.rb +247 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/rule.rb +350 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/version.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix.rb +177 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.8.1/ext/racc/cparse/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.8.1/lib/racc/cparse.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/redcarpet-3.6.1/ext/redcarpet/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/redcarpet-3.6.1/lib/redcarpet.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/NEWS.md +843 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/README.md +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/context.rdoc +143 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/child.rdoc +87 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/document.rdoc +276 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/element.rdoc +602 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/node.rdoc +97 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/parent.rdoc +267 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/child_toc.rdoc +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/document_toc.rdoc +30 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/element_toc.rdoc +55 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/master_toc.rdoc +135 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/node_toc.rdoc +16 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/parent_toc.rdoc +25 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tutorial.rdoc +1358 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/attlistdecl.rb +63 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/attribute.rb +210 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/cdata.rb +68 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/child.rb +96 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/comment.rb +80 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/doctype.rb +306 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/document.rb +471 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/attlistdecl.rb +11 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/dtd.rb +47 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/elementdecl.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/entitydecl.rb +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/notationdecl.rb +40 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/element.rb +2578 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/encoding.rb +48 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/entity.rb +142 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/default.rb +116 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/pretty.rb +142 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/transitive.rb +58 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/functions.rb +446 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/instruction.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/light/node.rb +188 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/namespace.rb +63 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/node.rb +80 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/output.rb +30 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parent.rb +166 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parseexception.rb +53 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/baseparser.rb +949 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/lightparser.rb +59 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/pullparser.rb +213 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/sax2parser.rb +270 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/streamparser.rb +67 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/treeparser.rb +89 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/ultralightparser.rb +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/xpathparser.rb +739 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/quickpath.rb +267 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/rexml.rb +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/sax2listener.rb +98 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/security.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/source.rb +388 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/streamlistener.rb +93 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/text.rb +420 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/undefinednamespaceexception.rb +9 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/relaxng.rb +540 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/validation.rb +144 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/validationexception.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xmldecl.rb +130 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xmltokens.rb +85 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xpath.rb +70 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xpath_parser.rb +980 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml.rb +3 -0
- data/vendor/bundle/ruby/3.2.0/gems/stringio-3.2.0/ext/stringio/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/stringio-3.2.0/lib/stringio.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/CHANGELOG.md +2148 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/LICENSE +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/README.md +1229 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/api.rb +111 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/assertion_failure.rb +13 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/callback_registry.rb +37 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/config.rb +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/cucumber.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/deprecation.rb +11 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/errors.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +228 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/curb_adapter.rb +354 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +239 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/excon_adapter.rb +167 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_lib_adapter.rb +9 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +21 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/client.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/request.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/response.rb +95 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/streamer.rb +44 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/webmock.rb +77 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb_adapter.rb +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/httpclient_adapter.rb +260 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/manticore_adapter.rb +147 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/net_http.rb +310 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/net_http_response.rb +36 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/patron_adapter.rb +132 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +190 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/any_arg_matcher.rb +15 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_argument_matcher.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_excluding_matcher.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_including_matcher.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/minitest.rb +43 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rack_response.rb +73 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_body_diff.rb +66 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_execution_verifier.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_pattern.rb +428 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_registry.rb +37 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_signature.rb +56 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_signature_snippet.rb +63 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_stub.rb +134 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/response.rb +161 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/responses_sequence.rb +42 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers/request_pattern_matcher.rb +80 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers/webmock_matcher.rb +69 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers.rb +29 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec.rb +44 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/stub_registry.rb +84 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/stub_request_snippet.rb +40 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/test_unit.rb +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_counter.rb +45 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_keys_stringifier.rb +27 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_validator.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/headers.rb +77 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/json.rb +72 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/parse_error.rb +7 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/xml.rb +16 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/query_mapper.rb +283 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/uri.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/values_stringifier.rb +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/version_checker.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/version.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/webmock.rb +175 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock.rb +61 -0
- data/vendor/bundle/ruby/3.2.0/gems/websocket-driver-0.8.0/ext/websocket-driver/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/websocket-driver-0.8.0/lib/websocket_mask.so +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/addressable-2.9.0.gemspec +29 -0
- data/vendor/bundle/ruby/3.2.0/specifications/crack-1.0.1.gemspec +27 -0
- data/vendor/bundle/ruby/3.2.0/specifications/faraday-2.14.1.gemspec +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/faraday-net_http-3.4.2.gemspec +26 -0
- data/vendor/bundle/ruby/3.2.0/specifications/hashdiff-1.2.1.gemspec +30 -0
- data/vendor/bundle/ruby/3.2.0/specifications/net-http-0.9.1.gemspec +27 -0
- data/vendor/bundle/ruby/3.2.0/specifications/public_suffix-7.0.5.gemspec +24 -0
- data/vendor/bundle/ruby/3.2.0/specifications/rexml-3.4.4.gemspec +25 -0
- data/vendor/bundle/ruby/3.2.0/specifications/webmock-3.26.2.gemspec +44 -0
- metadata +377 -2
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module IronAdmin
|
|
4
|
+
module Adapters
|
|
5
|
+
class Mongoid
|
|
6
|
+
# Wraps a Mongoid relation metadata object to present the interface
|
|
7
|
+
# expected by FieldInferrer and other IronAdmin consumers.
|
|
8
|
+
#
|
|
9
|
+
# Normalizes Mongoid's embedded association macros to their IronAdmin
|
|
10
|
+
# equivalents: embeds_many → :has_many, embeds_one → :has_one,
|
|
11
|
+
# embedded_in → :belongs_to.
|
|
12
|
+
class AssociationWrapper
|
|
13
|
+
# @return [Symbol] The association name
|
|
14
|
+
attr_reader :name
|
|
15
|
+
|
|
16
|
+
# @return [Symbol] The normalized macro (:belongs_to, :has_many, :has_one, :has_and_belongs_to_many)
|
|
17
|
+
attr_reader :macro
|
|
18
|
+
|
|
19
|
+
MACRO_MAP = {
|
|
20
|
+
embeds_many: :has_many,
|
|
21
|
+
embeds_one: :has_one,
|
|
22
|
+
embedded_in: :belongs_to,
|
|
23
|
+
}.freeze
|
|
24
|
+
|
|
25
|
+
def initialize(relation)
|
|
26
|
+
@relation = relation
|
|
27
|
+
@name = relation.name.to_sym
|
|
28
|
+
@macro = MACRO_MAP.fetch(raw_macro_for(relation), raw_macro_for(relation))
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
private
|
|
32
|
+
|
|
33
|
+
# Mongoid 9 dropped `Association#macro`. Derive the macro symbol
|
|
34
|
+
# from the association class name instead, e.g.
|
|
35
|
+
# `Mongoid::Association::Referenced::BelongsTo` → :belongs_to,
|
|
36
|
+
# `Mongoid::Association::Embedded::EmbedsMany` → :embeds_many.
|
|
37
|
+
# Falls back to `relation.macro` when defined (Mongoid <= 8).
|
|
38
|
+
#
|
|
39
|
+
# @param relation [Object] A Mongoid association metadata instance
|
|
40
|
+
# @return [Symbol] The macro symbol (e.g. :belongs_to, :has_many,
|
|
41
|
+
# :embeds_many, :embedded_in)
|
|
42
|
+
def raw_macro_for(relation)
|
|
43
|
+
return relation.macro if relation.respond_to?(:macro)
|
|
44
|
+
|
|
45
|
+
relation.class.name.split("::").last.underscore.to_sym
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
public
|
|
49
|
+
|
|
50
|
+
def klass
|
|
51
|
+
@relation.class_name.constantize
|
|
52
|
+
rescue NameError
|
|
53
|
+
nil
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def foreign_key
|
|
57
|
+
return "" unless @relation.respond_to?(:foreign_key)
|
|
58
|
+
|
|
59
|
+
@relation.foreign_key.to_s
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def polymorphic?
|
|
63
|
+
return false unless @relation.respond_to?(:polymorphic?)
|
|
64
|
+
|
|
65
|
+
@relation.polymorphic?
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def foreign_type
|
|
69
|
+
"#{@name}_type"
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module IronAdmin
|
|
4
|
+
module Adapters
|
|
5
|
+
# Mongoid adapter — wraps Mongoid's APIs behind the standard adapter interface.
|
|
6
|
+
#
|
|
7
|
+
# This adapter enables IronAdmin to work with MongoDB-backed models.
|
|
8
|
+
# It implements all abstract methods from Adapters::Base using Mongoid's
|
|
9
|
+
# query interface, field introspection, and association reflection.
|
|
10
|
+
#
|
|
11
|
+
# @example Configuring a resource to use Mongoid
|
|
12
|
+
# class ArticleResource < IronAdmin::Resource
|
|
13
|
+
# self.adapter_class = :mongoid
|
|
14
|
+
# end
|
|
15
|
+
class Mongoid < Base
|
|
16
|
+
# Maps Mongoid field types (Ruby classes) to IronAdmin symbol types.
|
|
17
|
+
MONGOID_TYPE_MAP = {
|
|
18
|
+
String => :string,
|
|
19
|
+
Integer => :integer,
|
|
20
|
+
Float => :float,
|
|
21
|
+
BigDecimal => :decimal,
|
|
22
|
+
Date => :date,
|
|
23
|
+
DateTime => :datetime,
|
|
24
|
+
Time => :datetime,
|
|
25
|
+
Hash => :json,
|
|
26
|
+
Array => :text,
|
|
27
|
+
Symbol => :string,
|
|
28
|
+
}.freeze
|
|
29
|
+
|
|
30
|
+
# --- Schema Introspection ---
|
|
31
|
+
|
|
32
|
+
def columns
|
|
33
|
+
model_class.fields.values.map do |field|
|
|
34
|
+
ColumnDescriptor.new(field.name, map_field_type(field))
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def column_names
|
|
39
|
+
model_class.fields.keys
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def has_column?(name) # rubocop:disable Naming/PredicatePrefix
|
|
43
|
+
model_class.fields.key?(name.to_s)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def enums
|
|
47
|
+
return model_class.defined_enums if model_class.respond_to?(:defined_enums)
|
|
48
|
+
|
|
49
|
+
{}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def associations(kind = nil)
|
|
53
|
+
wrappers = model_class.relations.values.map { |r| AssociationWrapper.new(r) }
|
|
54
|
+
kind ? wrappers.select { |w| w.macro == kind } : wrappers
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def association(name)
|
|
58
|
+
relation = model_class.relations[name.to_s]
|
|
59
|
+
relation ? AssociationWrapper.new(relation) : nil
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def attachments
|
|
63
|
+
{}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def rich_text_attributes
|
|
67
|
+
[]
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def polymorphic_inverse_classes(polymorphic_name)
|
|
71
|
+
return [] unless defined?(::Mongoid::Document)
|
|
72
|
+
|
|
73
|
+
classes = ObjectSpace.each_object(Class).filter_map do |klass|
|
|
74
|
+
next unless klass < ::Mongoid::Document
|
|
75
|
+
next unless mongoid_polymorphic_inverse?(klass, polymorphic_name)
|
|
76
|
+
|
|
77
|
+
klass
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
classes.sort_by { |klass| klass.name.to_s }
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# --- Naming ---
|
|
84
|
+
|
|
85
|
+
def table_name
|
|
86
|
+
model_class.collection_name.to_s
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Mongoid documents use `_id`. Composite keys are not supported by Mongoid,
|
|
90
|
+
# so this always returns a String, never an Array.
|
|
91
|
+
def primary_key
|
|
92
|
+
"_id"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# --- Query Building ---
|
|
96
|
+
|
|
97
|
+
delegate :all, to: :model_class
|
|
98
|
+
|
|
99
|
+
def find(id)
|
|
100
|
+
model_class.find(id)
|
|
101
|
+
rescue StandardError => e
|
|
102
|
+
raise IronAdmin::RecordNotFound, e.message if not_found_error?(e)
|
|
103
|
+
|
|
104
|
+
raise
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
delegate :find_by, to: :model_class
|
|
108
|
+
|
|
109
|
+
def filter(scope, column, value)
|
|
110
|
+
case value
|
|
111
|
+
when Array
|
|
112
|
+
scope.in(column => value)
|
|
113
|
+
when Range
|
|
114
|
+
build_range_filter(scope, column, value)
|
|
115
|
+
else
|
|
116
|
+
scope.where(column => value)
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def order_by(scope, column, direction)
|
|
121
|
+
scope.order_by(column => direction)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def limit(scope, max)
|
|
125
|
+
scope.limit(max)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def preload(scope, association_names)
|
|
129
|
+
scope.includes(*association_names)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def distinct_values(column)
|
|
133
|
+
model_class.distinct(column).compact.sort
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def pluck(scope, column)
|
|
137
|
+
scope.pluck(column)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def count(scope = nil)
|
|
141
|
+
(scope || all).count
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# --- Search ---
|
|
145
|
+
|
|
146
|
+
def search_column(scope, column, query)
|
|
147
|
+
pattern = /#{Regexp.escape(query)}/i
|
|
148
|
+
scope.where(column => pattern)
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def search_columns(scope, columns, query)
|
|
152
|
+
pattern = /#{Regexp.escape(query)}/i
|
|
153
|
+
conditions = columns.map { |col| { col => pattern } }
|
|
154
|
+
scope.any_of(*conditions)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# --- CRUD ---
|
|
158
|
+
|
|
159
|
+
def build(attrs = {})
|
|
160
|
+
model_class.new(cast_array_attributes(attrs))
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def save(record)
|
|
164
|
+
record.save
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
def update(record, attrs)
|
|
168
|
+
record.update(cast_array_attributes(attrs))
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def destroy!(record)
|
|
172
|
+
record.destroy!
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# --- Transactions ---
|
|
176
|
+
|
|
177
|
+
def transaction
|
|
178
|
+
yield
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# --- Scope Manipulation ---
|
|
182
|
+
|
|
183
|
+
def unscope_column(scope, column)
|
|
184
|
+
key = column.to_s
|
|
185
|
+
new_selector = scope.selector.reject { |k, _| k == key }
|
|
186
|
+
new_scope = model_class.where(new_selector)
|
|
187
|
+
new_scope = new_scope.order_by(scope.options[:sort]) if scope.options[:sort]
|
|
188
|
+
new_scope
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# --- Batch ---
|
|
192
|
+
|
|
193
|
+
def find_each(scope, &)
|
|
194
|
+
scope.batch_size(100).each(&)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# --- Adapter-Agnostic Interface ---
|
|
198
|
+
|
|
199
|
+
def record_changes(record)
|
|
200
|
+
record.previous_changes
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
def wrap_rollback
|
|
204
|
+
yield
|
|
205
|
+
rescue IronAdmin::Rollback
|
|
206
|
+
# Silently absorb rollback — Mongoid transactions (if used)
|
|
207
|
+
# are handled separately
|
|
208
|
+
nil
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
def query_builder_class
|
|
212
|
+
IronAdmin::Filters::MongoidQueryBuilder
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
def pagy_method
|
|
216
|
+
:pagy_mongoid
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
private
|
|
220
|
+
|
|
221
|
+
def map_field_type(field)
|
|
222
|
+
return :string if field.name == "_id"
|
|
223
|
+
|
|
224
|
+
MONGOID_TYPE_MAP.fetch(field.type) { boolean_or_text(field.type) }
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
def cast_array_attributes(attrs)
|
|
228
|
+
return attrs unless attrs.respond_to?(:each_pair)
|
|
229
|
+
|
|
230
|
+
attrs.each_pair.with_object(attrs.dup) do |(key, value), casted|
|
|
231
|
+
next unless array_field?(key) && value.is_a?(String)
|
|
232
|
+
|
|
233
|
+
casted[key] = value.split(",").map(&:strip).compact_blank
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
def array_field?(key)
|
|
238
|
+
model_class.fields[key.to_s]&.type == Array
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
def build_range_filter(scope, column, range)
|
|
242
|
+
conditions = {}
|
|
243
|
+
conditions["$gte"] = range.begin if range.begin
|
|
244
|
+
conditions["$lte"] = range.end if range.end
|
|
245
|
+
scope.where(column.to_s => conditions)
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
def not_found_error?(error)
|
|
249
|
+
error.class.name.include?("NotFound") ||
|
|
250
|
+
error.class.name.include?("DocumentNotFound") ||
|
|
251
|
+
error.message.include?("not found")
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
def boolean_or_text(type)
|
|
255
|
+
return :boolean if boolean_type?(type)
|
|
256
|
+
|
|
257
|
+
:text
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
def boolean_type?(type)
|
|
261
|
+
type_name = type.respond_to?(:name) ? type.name.to_s : type.to_s
|
|
262
|
+
type_name.include?("Boolean") || type == TrueClass || type == FalseClass
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
def mongoid_polymorphic_inverse?(klass, polymorphic_name)
|
|
266
|
+
return false unless klass.respond_to?(:relations)
|
|
267
|
+
|
|
268
|
+
klass.relations.values.any? do |relation|
|
|
269
|
+
next false unless %i[has_many has_one].include?(relation.macro)
|
|
270
|
+
|
|
271
|
+
relation_options(relation)[:as]&.to_sym == polymorphic_name.to_sym
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
def relation_options(relation)
|
|
276
|
+
relation.respond_to?(:options) ? relation.options : {}
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
end
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
require_relative "mongoid/column_descriptor"
|
|
283
|
+
require_relative "mongoid/association_wrapper"
|
|
284
|
+
require_relative "../filters/mongoid_query_builder"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module IronAdmin
|
|
4
|
+
module Adapters
|
|
5
|
+
# Lazily loads and resolves adapter classes by identifier.
|
|
6
|
+
#
|
|
7
|
+
# Adapters are loaded on demand to avoid requiring unnecessary ORM
|
|
8
|
+
# dependencies. ActiveRecord apps never load Mongoid code and vice versa.
|
|
9
|
+
#
|
|
10
|
+
# @example Resolving an adapter
|
|
11
|
+
# IronAdmin::Adapters::Registry.resolve(:active_record)
|
|
12
|
+
# #=> IronAdmin::Adapters::ActiveRecord
|
|
13
|
+
#
|
|
14
|
+
# @example Using a custom adapter (pass the class directly to adapter_class)
|
|
15
|
+
# self.adapter_class = MyGem::IronAdminAdapter
|
|
16
|
+
module Registry
|
|
17
|
+
ADAPTERS = {
|
|
18
|
+
active_record: {
|
|
19
|
+
require_path: "iron_admin/adapters/active_record",
|
|
20
|
+
class_name: "IronAdmin::Adapters::ActiveRecord",
|
|
21
|
+
},
|
|
22
|
+
mongoid: {
|
|
23
|
+
require_path: "iron_admin/adapters/mongoid",
|
|
24
|
+
class_name: "IronAdmin::Adapters::Mongoid",
|
|
25
|
+
},
|
|
26
|
+
http: {
|
|
27
|
+
require_path: "iron_admin/adapters/http",
|
|
28
|
+
class_name: "IronAdmin::Adapters::Http",
|
|
29
|
+
},
|
|
30
|
+
}.freeze
|
|
31
|
+
|
|
32
|
+
# Resolves an adapter identifier to its class.
|
|
33
|
+
#
|
|
34
|
+
# @param identifier [Symbol] The adapter identifier (e.g., :active_record, :mongoid)
|
|
35
|
+
# @return [Class] The adapter class
|
|
36
|
+
# @raise [ArgumentError] If the identifier is not registered
|
|
37
|
+
def self.resolve(identifier)
|
|
38
|
+
entry = ADAPTERS.fetch(identifier) { raise ArgumentError, "Unknown adapter: #{identifier}" }
|
|
39
|
+
require entry[:require_path]
|
|
40
|
+
entry[:class_name].constantize
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module IronAdmin
|
|
4
|
+
module Concerns
|
|
5
|
+
module Importable
|
|
6
|
+
extend ActiveSupport::Concern
|
|
7
|
+
|
|
8
|
+
module ImportDsl
|
|
9
|
+
def imports(*formats)
|
|
10
|
+
self.import_formats = formats.flatten.map(&:to_sym)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def import_enabled?
|
|
14
|
+
import_formats.any?
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def import_fields(*fields)
|
|
18
|
+
self.import_field_names = fields.map(&:to_sym)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def import_upsert_key(*fields)
|
|
22
|
+
self.import_upsert_key_names = fields.map(&:to_sym)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def import_transform(&block)
|
|
26
|
+
self.import_transform_block = block
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def import_validate(&block)
|
|
30
|
+
self.import_validate_block = block
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def import_options(**options)
|
|
34
|
+
self.import_options_hash = import_options_hash.merge(options)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def importable_fields(current_user = nil)
|
|
38
|
+
import_base_fields
|
|
39
|
+
.select { |field| field.visible?(current_user) && !field.readonly?(current_user) }
|
|
40
|
+
.reject { |field| import_excluded_field_type?(field.type) }
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
private
|
|
44
|
+
|
|
45
|
+
def import_base_fields
|
|
46
|
+
return resolved_fields.select { |field| field.name.in?(import_field_names) } if import_field_names
|
|
47
|
+
|
|
48
|
+
resolved_fields.reject { |field| field.name.in?(%i[id created_at updated_at]) }
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def import_excluded_field_type?(field_type)
|
|
52
|
+
field_type.in?(
|
|
53
|
+
%i[
|
|
54
|
+
belongs_to
|
|
55
|
+
polymorphic_belongs_to
|
|
56
|
+
has_many
|
|
57
|
+
has_one
|
|
58
|
+
has_and_belongs_to_many
|
|
59
|
+
file
|
|
60
|
+
files
|
|
61
|
+
rich_text
|
|
62
|
+
]
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
included do
|
|
68
|
+
class_attribute :import_formats, default: []
|
|
69
|
+
class_attribute :import_field_names, default: nil
|
|
70
|
+
class_attribute :import_upsert_key_names, default: []
|
|
71
|
+
class_attribute :import_transform_block, default: nil
|
|
72
|
+
class_attribute :import_validate_block, default: nil
|
|
73
|
+
class_attribute :import_options_hash, default: { max_rows: 5_000, preview_rows: 20 }
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
class_methods do
|
|
77
|
+
include ImportDsl
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module IronAdmin
|
|
4
|
+
module Concerns
|
|
5
|
+
module LiveUpdatable
|
|
6
|
+
extend ActiveSupport::Concern
|
|
7
|
+
|
|
8
|
+
included do
|
|
9
|
+
class_attribute :live_index_enabled, default: false
|
|
10
|
+
class_attribute :live_show_enabled, default: false
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class_methods do
|
|
14
|
+
def live_index(value = nil, enabled: true)
|
|
15
|
+
self.live_index_enabled = value.nil? ? enabled : value
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def live_show(value = nil, enabled: true)
|
|
19
|
+
self.live_show_enabled = value.nil? ? enabled : value
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def live_index_enabled?
|
|
23
|
+
!!live_index_enabled
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def live_show_enabled?
|
|
27
|
+
!!live_show_enabled
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def live_stream_name(scope, record_id = nil)
|
|
31
|
+
parts = ["resources", resource_name, scope]
|
|
32
|
+
parts << record_id if record_id
|
|
33
|
+
parts.join(":")
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module IronAdmin
|
|
4
|
+
module Concerns
|
|
5
|
+
# Provides nested association support for Resource classes.
|
|
6
|
+
#
|
|
7
|
+
# Extends has_many/has_one with nested: kwargs, adds nested_associations
|
|
8
|
+
# reader, and field resolution.
|
|
9
|
+
module Nestable
|
|
10
|
+
extend ActiveSupport::Concern
|
|
11
|
+
|
|
12
|
+
# DSL methods for declaring has_many/has_one with nested options.
|
|
13
|
+
module AssociationDsl
|
|
14
|
+
def has_many(name, nested: false, allow_destroy: true, position_field: nil, fields: nil, **options)
|
|
15
|
+
self.defined_associations = defined_associations.merge(
|
|
16
|
+
name => {
|
|
17
|
+
kind: :has_many, nested: nested, allow_destroy: allow_destroy,
|
|
18
|
+
position_field: position_field&.to_sym, fields: fields&.map(&:to_sym), **options,
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def has_one(name, nested: false, allow_destroy: true, fields: nil, **options)
|
|
24
|
+
self.defined_associations = defined_associations.merge(
|
|
25
|
+
name => {
|
|
26
|
+
kind: :has_one, nested: nested, allow_destroy: allow_destroy,
|
|
27
|
+
fields: fields&.map(&:to_sym), **options,
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Reader and resolver for nested associations.
|
|
34
|
+
module NestedReader
|
|
35
|
+
def nested_associations
|
|
36
|
+
defined_associations.select { |_, v| v[:nested] }.map do |assoc_name, config|
|
|
37
|
+
reflection = adapter.association(assoc_name)
|
|
38
|
+
raise ArgumentError, "Unknown association #{assoc_name} for #{model.name}" unless reflection
|
|
39
|
+
|
|
40
|
+
NestedAttributesValidator.validate!(model, assoc_name)
|
|
41
|
+
fields = resolve_nested_fields(config, reflection.klass, reflection.foreign_key)
|
|
42
|
+
|
|
43
|
+
NestedAssociation.new(
|
|
44
|
+
name: assoc_name, kind: config[:kind], reflection: reflection,
|
|
45
|
+
fields: fields, allow_destroy: config.fetch(:allow_destroy, true),
|
|
46
|
+
position_field: config[:position_field]
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
private
|
|
52
|
+
|
|
53
|
+
def resolve_nested_fields(config, assoc_model, foreign_key)
|
|
54
|
+
if config[:fields]
|
|
55
|
+
FieldInferrer.call(assoc_model).select { |f| config[:fields].include?(f.name) }
|
|
56
|
+
else
|
|
57
|
+
skip = %i[id created_at updated_at] + [foreign_key.to_sym]
|
|
58
|
+
FieldInferrer.call(assoc_model).reject { |f| skip.include?(f.name) }
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
class_methods do
|
|
64
|
+
include AssociationDsl
|
|
65
|
+
include NestedReader
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "active_support/concern"
|
|
4
|
+
|
|
5
|
+
module IronAdmin
|
|
6
|
+
module Concerns
|
|
7
|
+
# Adds the auto-registered soft-delete features (`with_deleted` /
|
|
8
|
+
# `only_deleted` scopes and the `:restore` action) when the underlying
|
|
9
|
+
# model has a `deleted_at` column.
|
|
10
|
+
#
|
|
11
|
+
# Extracted from `IronAdmin::Resource` so the registration logic can
|
|
12
|
+
# evolve independently — and so the parent class stays under the
|
|
13
|
+
# configured `Metrics/ClassLength` budget.
|
|
14
|
+
module SoftDeletable
|
|
15
|
+
extend ActiveSupport::Concern
|
|
16
|
+
|
|
17
|
+
class_methods do
|
|
18
|
+
# @return [Boolean] True if the model has a `deleted_at` column.
|
|
19
|
+
def soft_delete?
|
|
20
|
+
adapter.has_column?(soft_delete_column)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# @return [String] Column name used for soft-delete tracking.
|
|
24
|
+
def soft_delete_column
|
|
25
|
+
"deleted_at"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Idempotently registers soft-delete scopes and the `:restore`
|
|
29
|
+
# action on this resource. Tolerates a missing/unreachable DB at
|
|
30
|
+
# boot time so `bin/rails db:create` and short outages during
|
|
31
|
+
# deploy don't crash boot — the skip is logged. Safe to call
|
|
32
|
+
# multiple times: the negative result is cached too so we don't
|
|
33
|
+
# re-introspect the schema on every register / finalize! cycle.
|
|
34
|
+
#
|
|
35
|
+
# @return [void]
|
|
36
|
+
def register_soft_delete_features
|
|
37
|
+
return if @soft_delete_features_registered
|
|
38
|
+
return @soft_delete_features_registered = true unless soft_delete?
|
|
39
|
+
|
|
40
|
+
column = soft_delete_column
|
|
41
|
+
column_sym = column.to_sym
|
|
42
|
+
|
|
43
|
+
self._soft_delete_scopes = [
|
|
44
|
+
{ name: :with_deleted, scope: -> { unscope(where: column_sym) }, default: false },
|
|
45
|
+
{ name: :only_deleted, scope: -> { unscope(where: column_sym).where.not(column => nil) }, default: false },
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
action :restore, icon: "arrow-path", condition: ->(record) { record.public_send(column).present? } do |record|
|
|
49
|
+
record.update(column => nil)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
@soft_delete_features_registered = true
|
|
53
|
+
rescue *IronAdmin.db_unreachable_exceptions => e
|
|
54
|
+
msg = "[IronAdmin] Skipping soft-delete features for #{name}: #{e.class} (#{e.message})"
|
|
55
|
+
(defined?(Rails) ? Rails.logger : nil)&.warn(msg)
|
|
56
|
+
nil
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -81,6 +81,21 @@ module IronAdmin
|
|
|
81
81
|
# @return [Boolean] Whether the actions column stays fixed on horizontal scroll (default: true)
|
|
82
82
|
attr_accessor :sticky_actions_column
|
|
83
83
|
|
|
84
|
+
# @return [String, nil] Base URL for HTTP adapter (e.g., "https://api.example.com/v1")
|
|
85
|
+
attr_accessor :http_base_url
|
|
86
|
+
|
|
87
|
+
# @return [Hash] Default headers for HTTP adapter (e.g., auth tokens)
|
|
88
|
+
attr_accessor :http_headers
|
|
89
|
+
|
|
90
|
+
# @return [Symbol] Live update strategy (:disabled or :polling)
|
|
91
|
+
attr_accessor :live_updates
|
|
92
|
+
|
|
93
|
+
# @return [ActiveSupport::Duration] Client polling interval for live updates
|
|
94
|
+
attr_accessor :live_poll_interval
|
|
95
|
+
|
|
96
|
+
# @return [ActiveSupport::Duration] Minimum interval between live broadcasts
|
|
97
|
+
attr_accessor :live_throttle
|
|
98
|
+
|
|
84
99
|
# @return [Proc, nil] Authentication block
|
|
85
100
|
# @see #authenticate
|
|
86
101
|
attr_reader :authenticate_block
|
|
@@ -171,6 +186,11 @@ module IronAdmin
|
|
|
171
186
|
@audit_enabled = false
|
|
172
187
|
@audit_storage = :memory
|
|
173
188
|
@sticky_actions_column = true
|
|
189
|
+
@http_base_url = nil
|
|
190
|
+
@http_headers = {}
|
|
191
|
+
@live_updates = :disabled
|
|
192
|
+
@live_poll_interval = 3.seconds
|
|
193
|
+
@live_throttle = 0.5.seconds
|
|
174
194
|
end
|
|
175
195
|
|
|
176
196
|
# Defines the authentication check for admin access.
|