app/controllers/calagator/events_controller.rb in calagator-1.0.0.rc3 vs app/controllers/calagator/events_controller.rb in calagator-1.0.0
- old
+ new
@@ -1,12 +1,14 @@
+require "recaptcha/rails"
+require "calagator/duplicate_checking"
require "calagator/duplicate_checking/controller_actions"
module Calagator
class EventsController < Calagator::ApplicationController
# Provides #duplicates and #squash_many_duplicates
- include DuplicateChecking::ControllerActions
+ include Calagator::DuplicateChecking::ControllerActions
require_admin only: [:duplicates, :squash_many_duplicates]
before_filter :find_and_redirect_if_locked, :only => [:edit, :update, :destroy]
# GET /events
@@ -53,10 +55,10 @@
end
def create_or_update
saver = Event::Saver.new(@event, params.permit!)
respond_to do |format|
- if saver.save
+ if recaptcha_verified?(@event) && saver.save
format.html {
flash[:success] = 'Event was successfully saved.'
if saver.has_new_venue?
flash[:success] += " Please tell us more about where it's being held."
redirect_to edit_venue_url(@event.venue, from_event: @event.id)