diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2af78545..0f0dab5e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -34,8 +34,8 @@ def add_pagination_headers(collection) def authenticate_from_token token = AuthToken.find_authenticated( { - secret: (request.headers[:'x-secret'] || params[:secret]), - device_id: (request.headers[:'x-device-id'] || params[:device_id]) + secret: request.headers[:'x-secret'] || params[:secret], + device_id: request.headers[:'x-device-id'] || params[:device_id] } ) self.current_user = token&.user diff --git a/app/models/concerns/has_normalized.rb b/app/models/concerns/has_normalized.rb index c24ff10c..0cc3e13e 100644 --- a/app/models/concerns/has_normalized.rb +++ b/app/models/concerns/has_normalized.rb @@ -5,9 +5,9 @@ module HasNormalized class_methods do def normalized_col_generator(col_name) col = col_name.to_sym - normalized_col = "normalized_#{col_name}".to_sym - generate_normalized_col = "generate_normalized_#{col_name}".to_sym - col_changed = "#{col_name}_changed?".to_sym + normalized_col = :"normalized_#{col_name}" + generate_normalized_col = :"generate_normalized_#{col_name}" + col_changed = :"#{col_name}_changed?" set_callback :validation, :before, generate_normalized_col, if: col_changed