gitlab-org--gitlab-foss/app/services/user_agent_detail_service.rb
2016-08-15 17:20:57 -05:00

13 lines
349 B
Ruby

class UserAgentDetailService
attr_accessor :spammable, :request
def initialize(spammable, request)
@spammable, @request = spammable, request
end
def create
return unless request
spammable.create_user_agent_detail(user_agent: request.env['HTTP_USER_AGENT'], ip_address: request.env['action_dispatch.remote_ip'].to_s)
end
end