Class: SetUserCountryJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/set_user_country_job.rb

Constant Summary collapse

DEFAULT_COUNTRY_CODE =
'ru'.freeze

Instance Method Summary collapse

Instance Method Details

#perform(user) ⇒ Object


6
7
8
9
10
11
12
# File 'app/jobs/set_user_country_job.rb', line 6

def perform(user)
  @user = user

  return unless country_update_required?

  user.update_attributes(country_code: country_code(user..to_s))
end