Merge branch 'master' into user-recomendations
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class Admin::Poll::ShiftsController < Admin::BaseController
|
||||
|
||||
|
||||
before_action :load_booth
|
||||
before_action :load_polls
|
||||
before_action :load_officer
|
||||
|
||||
@@ -7,7 +7,7 @@ class CommunitiesController < ApplicationController
|
||||
skip_authorization_check
|
||||
|
||||
def show
|
||||
redirect_to root_path unless Setting['feature.community'].present?
|
||||
redirect_to root_path if Setting['feature.community'].blank?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class DocumentsController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
before_filter :find_documentable, except: :destroy
|
||||
before_filter :prepare_new_document, only: [:new, :new_nested]
|
||||
before_filter :prepare_document_for_creation, only: :create
|
||||
before_action :find_documentable, except: :destroy
|
||||
before_action :prepare_new_document, only: [:new, :new_nested]
|
||||
before_action :prepare_document_for_creation, only: :create
|
||||
|
||||
load_and_authorize_resource except: :upload
|
||||
skip_authorization_check only: :upload
|
||||
@@ -48,6 +48,7 @@ class DocumentsController < ApplicationController
|
||||
def destroy_upload
|
||||
@document = Document.new(cached_attachment: params[:path])
|
||||
@document.set_attachment_from_cached_attachment
|
||||
@document.cached_attachment = nil
|
||||
@document.documentable = @documentable
|
||||
|
||||
if @document.attachment.destroy
|
||||
|
||||
@@ -7,7 +7,7 @@ class Officing::PollsController < Officing::BaseController
|
||||
|
||||
def final
|
||||
@polls = if current_user.poll_officer?
|
||||
current_user.poll_officer.final_days_assigned_polls.select {|poll| poll.ends_at > 1.week.ago && poll.expired?}
|
||||
current_user.poll_officer.final_days_assigned_polls.select {|poll| poll.ends_at > 2.week.ago && poll.expired?}
|
||||
else
|
||||
[]
|
||||
end
|
||||
|
||||
@@ -78,7 +78,7 @@ class ProposalsController < ApplicationController
|
||||
def proposal_params
|
||||
params.require(:proposal).permit(:title, :question, :summary, :description, :external_url, :video_url,
|
||||
:responsible_name, :tag_list, :terms_of_service, :geozone_id,
|
||||
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id] )
|
||||
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id])
|
||||
end
|
||||
|
||||
def retired_params
|
||||
|
||||
Reference in New Issue
Block a user