Run rubocop --fix-layout and remove encoding comments

This commit is contained in:
Patrick Gansterer 2021-03-01 15:27:26 +01:00
parent fa63e6e81d
commit ea2862fdef
283 changed files with 1164 additions and 1969 deletions

View file

@ -23,8 +23,6 @@ end
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'
Bundler::GemHelper.install_tasks
require 'rake/testtask'
@ -36,5 +34,4 @@ Rake::TestTask.new(:test) do |t|
t.verbose = false
end
task :default => :test

View file

@ -63,6 +63,7 @@ class PollsController < ApplicationController
if @poll.one_vote_per_ordergroup
ordergroup = current_user.ordergroup
return redirect_to polls_path, alert: t('.no_ordergroup') unless ordergroup
attributes = { ordergroup: ordergroup }
else
attributes = { user: current_user }
@ -103,8 +104,8 @@ class PollsController < ApplicationController
params
.require(:poll)
.permit(:name, :starts_date_value, :starts_time_value, :ends_date_value,
:ends_time_value, :description, :one_vote_per_ordergroup, :voting_method,
:multi_select_count, :min_points, :max_points, choices: [],
required_ordergroup_custom_fields: [], required_user_custom_fields: [])
:ends_time_value, :description, :one_vote_per_ordergroup, :voting_method,
:multi_select_count, :min_points, :max_points, choices: [],
required_ordergroup_custom_fields: [], required_user_custom_fields: [])
end
end

View file

@ -1,5 +1,4 @@
class Poll < ActiveRecord::Base
# @!attribute required_ordergroup_custom_fields
# A list of custom_fileds, which are required to poll.
# If the required field on the ordergroup of the user
@ -29,6 +28,7 @@ class Poll < ActiveRecord::Base
def available_points
return 0...0 if min_points.nil? || max_points.nil?
min_points..max_points
end

View file

@ -1,14 +1,10 @@
Rails.application.routes.draw do
scope '/:foodcoop' do
resources :polls do
member do
get :vote
post :vote
end
end
end
end

View file

@ -3,6 +3,7 @@ module FoodsoftPolls
def navigation(primary, context)
return unless FoodsoftPolls.enabled?
return if primary[:foodcoop].nil?
sub_nav = primary[:foodcoop].sub_navigation
sub_nav.items <<
SimpleNavigation::Item.new(primary, :polls, I18n.t('navigation.polls'), context.polls_path)