2016-07-27 20:03:06 -04:00
|
|
|
class UserAgentDetailService
|
2016-07-30 00:18:32 -04:00
|
|
|
attr_accessor :spammable, :request
|
2016-07-27 20:03:06 -04:00
|
|
|
|
2016-07-30 00:18:32 -04:00
|
|
|
def initialize(spammable, request)
|
|
|
|
@spammable, @request = spammable, request
|
2016-07-27 20:03:06 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
|
|
|
return unless request
|
2016-08-09 13:43:47 -04:00
|
|
|
|
2016-07-30 00:18:32 -04:00
|
|
|
spammable.create_user_agent_detail(user_agent: request.env['HTTP_USER_AGENT'], ip_address: request.env['action_dispatch.remote_ip'].to_s)
|
2016-07-27 20:03:06 -04:00
|
|
|
end
|
|
|
|
end
|