From 89341ce266b085bbd15bc2907101f590adfea47e Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 27 Mar 2019 19:14:16 +0000 Subject: [PATCH 1/1] erblint: avoid dynamic find_by methods --- .erb-lint.yml | 2 -- app/views/site/_potlatch.html.erb | 2 +- app/views/site/_potlatch2.html.erb | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.erb-lint.yml b/.erb-lint.yml index d0ccb0c0d..3cca0301c 100644 --- a/.erb-lint.yml +++ b/.erb-lint.yml @@ -25,8 +25,6 @@ linters: Enabled: false Rails/OutputSafety: Enabled: false - Rails/DynamicFindBy: - Enabled: false # TODO Layout/LeadingBlankLines: Enabled: false # TODO exclude: diff --git a/app/views/site/_potlatch.html.erb b/app/views/site/_potlatch.html.erb index 745fb2012..3ebcf7fab 100644 --- a/app/views/site/_potlatch.html.erb +++ b/app/views/site/_potlatch.html.erb @@ -1,7 +1,7 @@ <%= javascript_include_tag "edit/potlatch" %>
- <% session[:token] = current_user.tokens.create.token unless session[:token] && UserToken.find_by_token(session[:token]) -%> + <% session[:token] = current_user.tokens.create.token unless session[:token] && UserToken.find_by(:token => session[:token]) -%> <% data = { :token => session[:token] } -%> <% data[:lat] = @lat if @lat -%> <% data[:lon] = @lon if @lon -%> diff --git a/app/views/site/_potlatch2.html.erb b/app/views/site/_potlatch2.html.erb index bb6d3f81e..11519c26e 100644 --- a/app/views/site/_potlatch2.html.erb +++ b/app/views/site/_potlatch2.html.erb @@ -1,7 +1,7 @@ <%= javascript_include_tag "edit/potlatch2" %>
- <% session[:token] = current_user.tokens.create.token unless session[:token] && UserToken.find_by_token(session[:token]) -%> + <% session[:token] = current_user.tokens.create.token unless session[:token] && UserToken.find_by(:token => session[:token]) -%> <% data = { :token => session[:token] } -%> <% data[:lat] = @lat if @lat -%> <% data[:lon] = @lon if @lon -%> -- 2.39.5