#756: fixed "NoMethodError: protected method `perform' "

This commit is contained in:
Vokhmin Alexey V 2013-02-06 14:14:36 +04:00
parent a86ee3ebf0
commit ce9c425ba1
4 changed files with 10 additions and 12 deletions

View File

@ -8,22 +8,22 @@ module AbfWorker
attr_accessor :status, :options
protected
def initialize(options, subject_class)
@status = options['status'].to_i
@options = options
@subject_class = subject_class
end
def subject
@subject ||= @subject_class.find options['id']
end
def perform
raise NotImplementedError, "You should implement this method"
end
protected
def subject
@subject ||= @subject_class.find options['id']
end
def update_results
results = (subject.results || []) + options['results']
sort_results_and_save results

View File

@ -6,8 +6,6 @@ module AbfWorker
new(options, ProductBuildList).perform
end
protected
def perform
case status
when COMPLETED

View File

@ -7,8 +7,6 @@ module AbfWorker
new(options, BuildList).perform
end
protected
def perform
return if status == STARTED # do nothing when publication started
if options['type'] == 'resign'
@ -28,6 +26,8 @@ module AbfWorker
end
end
protected
def update_rpm_builds
build_lists = BuildList.where(:id => options['build_list_ids'])
build_lists.each do |build_list|

View File

@ -8,8 +8,6 @@ module AbfWorker
new(options, BuildList).perform
end
protected
def perform
item = find_or_create_item
@ -34,6 +32,8 @@ module AbfWorker
item.update_attributes({:status => BuildList::SUCCESS}) if [TESTS_FAILED, COMPLETED].include?(status)
end
protected
def find_or_create_item
subject.items.first || subject.items.create({
:version => subject.commit_hash,