Skip to content

Commit

Permalink
Make payload_state a public method
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed Aug 19, 2016
1 parent 690cdd3 commit b1a97be
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/jobs/cangaroo/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ def transform
{ type.singularize => payload }
end

def payload_state
other_translation = translation.related_translations.first

if other_translation.present?
:updated
else
:new
end
end

protected if !Rails.env.test?

def connection_request
Expand Down Expand Up @@ -78,16 +88,6 @@ def destination_connection
@connection ||= Cangaroo::Connection.find_by!(name: connection)
end

def payload_state
other_translation = translation.related_translations.first

if other_translation.present?
:updated
else
:new
end
end

def translation
# NOTE @job_id will remain consistent across retries
# TODO we should move this logic to the translation model
Expand Down

0 comments on commit b1a97be

Please sign in to comment.