Skip to content

Commit

Permalink
Use module when referring to obs_factory StagingProject
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarcoux committed Nov 6, 2018
1 parent e75be6b commit 341f8d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/api/app/models/obs_factory/distribution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ def published_version
#
# @return [Array] array of StagingProject objects
def staging_projects
@staging_projects ||= StagingProject.for(self)
@staging_projects ||= ObsFactory::StagingProject.for(self)
end

# Staging projects associated to the distribution, including non-letter
#
# @return [Array] array of StagingProject objects
def staging_projects_all
@staging_projects ||= StagingProject.for(self, false)
@staging_projects ||= ObsFactory::StagingProject.for(self, false)
end

# Version of the distribution used as source
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/models/obs_factory/staging_project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class StagingProject
def self.for(distribution, only_letter = true)
wildcard = only_letter ? "_" : "%"
::Project.where(["name like ?", "#{distribution.root_project_name}#{NAME_PREFIX}#{wildcard}"]).
map { |project| StagingProject.new(project: project, distribution: distribution) }
map { |project| ObsFactory::StagingProject.new(project: project, distribution: distribution) }
end

# Find a staging project by distribution and id
Expand All @@ -30,7 +30,7 @@ def self.for(distribution, only_letter = true)
def self.find(distribution, id)
project = ::Project.find_by_name("#{distribution.root_project_name}#{NAME_PREFIX}#{id}")
if project
StagingProject.new(project: project, distribution: distribution)
ObsFactory::StagingProject.new(project: project, distribution: distribution)
end
end

Expand Down

0 comments on commit 341f8d5

Please sign in to comment.