Fixed rubocop checks.
This commit is contained in:
parent
1e7e53d852
commit
0b55cd8147
5 changed files with 6 additions and 9 deletions
|
@ -34,7 +34,7 @@ class SearchController < ApplicationController
|
|||
next if !preferences
|
||||
objects_in_order_hash[preferences[:prio]] = object
|
||||
}
|
||||
objects_in_order_hash.keys.sort.reverse.each {|prio|
|
||||
objects_in_order_hash.keys.sort.reverse_each {|prio|
|
||||
objects_in_order.push objects_in_order_hash[prio]
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ store device for user
|
|||
end
|
||||
|
||||
# get browser details
|
||||
browser = Browser.new(:ua => user_agent, :accept_language => 'en-us')
|
||||
browser = Browser.new(ua: user_agent, accept_language: 'en-us')
|
||||
browser = {
|
||||
plattform: browser.platform.to_s.camelize,
|
||||
name: browser.name,
|
||||
|
@ -73,7 +73,7 @@ store device for user
|
|||
end
|
||||
|
||||
# check if exists
|
||||
user_device = self.find_by(
|
||||
user_device = find_by(
|
||||
user_id: user_id,
|
||||
os: browser[:plattform],
|
||||
browser: browser[:name],
|
||||
|
@ -85,7 +85,7 @@ store device for user
|
|||
end
|
||||
|
||||
# create new device
|
||||
user_device = self.create(
|
||||
user_device = create(
|
||||
user_id: user_id,
|
||||
name: name,
|
||||
os: browser[:plattform],
|
||||
|
@ -120,7 +120,7 @@ log user device action
|
|||
|
||||
=end
|
||||
|
||||
def self.action(user_device_id, user_agent, ip, user_id)
|
||||
def self.action(user_device_id, _user_agent, ip, _user_id)
|
||||
user_device = UserDevice.find(user_device_id)
|
||||
|
||||
# update location if needed
|
||||
|
|
|
@ -64,7 +64,7 @@ returns
|
|||
|
||||
def self.searchable
|
||||
models = []
|
||||
all.each {|model_class, options|
|
||||
all.each {|model_class, _options|
|
||||
next if !model_class
|
||||
next if !model_class.respond_to? :search_preferences
|
||||
models.push model_class
|
||||
|
|
|
@ -452,5 +452,4 @@ class SearchControllerTest < ActionDispatch::IntegrationTest
|
|||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
|
|
@ -21,7 +21,6 @@ class UserDeviceTest < ActiveSupport::TestCase
|
|||
)
|
||||
end
|
||||
|
||||
|
||||
test 'session test' do
|
||||
|
||||
# signin with fingerprint A from country A via session -> new device #1
|
||||
|
@ -186,5 +185,4 @@ class UserDeviceTest < ActiveSupport::TestCase
|
|||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue