Class: Packages::Maven::Package
- Inherits:
-
Package
- Object
- ActiveRecord::Base
- ApplicationRecord
- Package
- Packages::Maven::Package
- Defined in:
- app/models/packages/maven/package.rb
Constant Summary
Constants inherited from Package
Package::DETAILED_INFO_STATUSES, Package::DISPLAYABLE_STATUSES, Package::INSTALLABLE_STATUSES, Package::STATUS_MESSAGE_MAX_LENGTH
Constants included from Gitlab::SQL::Pattern
Gitlab::SQL::Pattern::MIN_CHARS_FOR_PARTIAL_MATCHING, Gitlab::SQL::Pattern::REGEX_QUOTED_TERM
Constants inherited from ApplicationRecord
Constants included from HasCheckConstraints
HasCheckConstraints::NOT_NULL_CHECK_PATTERN
Constants included from ResetOnColumnErrors
ResetOnColumnErrors::MAX_RESET_PERIOD
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Package
by_file_name_and_sha256, by_name_and_file_name, by_name_and_version!, #create_build_infos!, #detailed_info?, inheritance_column, inheritance_column_to_class_map, installable_statuses, #last_build_info, #mark_package_files_for_destruction, #package_settings, package_type_to_class!, #pipeline, pluck_names, pluck_versions, #publish_creation_event, sort_by_attribute, #tag_names, #versions
Methods included from Downloadable
Methods included from Gitlab::SQL::Pattern
Methods inherited from ApplicationRecord
===, cached_column_list, #create_or_load_association, current_transaction, declarative_enum, default_select_columns, delete_all_returning, #deleted_from_database?, id_in, id_not_in, iid_in, nullable_column?, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order
Methods included from Organizations::Sharding
Methods included from ResetOnColumnErrors
#reset_on_union_error, #reset_on_unknown_attribute_error
Methods included from Gitlab::SensitiveSerializableHash
Class Method Details
.only_maven_packages_with_path(path, use_cte: false) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/models/packages/maven/package.rb', line 15 def self.only_maven_packages_with_path(path, use_cte: false) if use_cte # This is an optimization fence which assumes that looking up the Metadatum record by path (globally) # and then filter down the packages (by project or by group and subgroups) will be cheaper than # looking up all packages within a project or group and filter them by path. inner_query = Packages::Maven::Metadatum.where(path: path).select(:id, :package_id) cte = Gitlab::SQL::CTE.new(:maven_metadata_by_path, inner_query) with(cte.to_arel) .joins('INNER JOIN maven_metadata_by_path ON maven_metadata_by_path.package_id=packages_packages.id') else joins(:maven_metadatum).where(packages_maven_metadata: { path: path }) end end |
Instance Method Details
#sync_maven_metadata(user) ⇒ Object
30 31 32 33 34 |
# File 'app/models/packages/maven/package.rb', line 30 def (user) return unless version? && user ::Packages::Maven::Metadata::SyncWorker.perform_async(user.id, project_id, name) end |