Run rubocop --fix-layout and remove encoding comments
This commit is contained in:
parent
fa63e6e81d
commit
ea2862fdef
283 changed files with 1164 additions and 1969 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue