Class: ReleasesFinder
- Inherits:
-
Object
- Object
- ReleasesFinder
- Includes:
- Gitlab::Utils::StrongMemoize
- Defined in:
- app/finders/releases_finder.rb
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #execute(preload: true) ⇒ Object
-
#initialize(parent, current_user = nil, params = {}) ⇒ ReleasesFinder
constructor
A new instance of ReleasesFinder.
Methods included from Gitlab::Utils::StrongMemoize
#clear_memoization, #strong_memoize, #strong_memoized?
Constructor Details
#initialize(parent, current_user = nil, params = {}) ⇒ ReleasesFinder
Returns a new instance of ReleasesFinder.
8 9 10 11 12 |
# File 'app/finders/releases_finder.rb', line 8 def initialize(parent, current_user = nil, params = {}) @parent = parent @current_user = current_user @params = params end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user
6 7 8 |
# File 'app/finders/releases_finder.rb', line 6 def current_user @current_user end |
#params ⇒ Object (readonly)
Returns the value of attribute params
6 7 8 |
# File 'app/finders/releases_finder.rb', line 6 def params @params end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent
6 7 8 |
# File 'app/finders/releases_finder.rb', line 6 def parent @parent end |
Instance Method Details
#execute(preload: true) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'app/finders/releases_finder.rb', line 14 def execute(preload: true) return Release.none if projects.empty? releases = get_releases releases = by_tag(releases) releases = releases.preloaded if preload releases.sorted end |