Merge pull request #78 from ChrisBr/fix_rails4_issues
Fix rails4 issues
This commit is contained in:
commit
08d4bb848b
10 changed files with 23 additions and 21 deletions
1
Gemfile
1
Gemfile
|
|
@ -36,6 +36,7 @@ gem 'uglifier', '>= 1.3.0'
|
||||||
# Use bootstrap as the front-end framework
|
# Use bootstrap as the front-end framework
|
||||||
gem 'bootstrap-sass'
|
gem 'bootstrap-sass'
|
||||||
gem 'formtastic-bootstrap'
|
gem 'formtastic-bootstrap'
|
||||||
|
gem 'formtastic', '~> 2.3.0.rc3'
|
||||||
|
|
||||||
|
|
||||||
# Use jquery as the JavaScript library
|
# Use jquery as the JavaScript library
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ GEM
|
||||||
factory_girl_rails (4.4.1)
|
factory_girl_rails (4.4.1)
|
||||||
factory_girl (~> 4.4.0)
|
factory_girl (~> 4.4.0)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
formtastic (2.2.1)
|
formtastic (2.3.0.rc3)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
formtastic-bootstrap (3.0.0)
|
formtastic-bootstrap (3.0.0)
|
||||||
formtastic (>= 2.2)
|
formtastic (>= 2.2)
|
||||||
|
|
@ -183,7 +183,7 @@ GEM
|
||||||
yajl-ruby (~> 1.1)
|
yajl-ruby (~> 1.1)
|
||||||
rest-client (1.6.7)
|
rest-client (1.6.7)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
rspec-collection_matchers (0.0.3)
|
rspec-collection_matchers (0.0.4)
|
||||||
rspec-expectations (>= 2.99.0.beta1)
|
rspec-expectations (>= 2.99.0.beta1)
|
||||||
rspec-core (3.0.0.beta2)
|
rspec-core (3.0.0.beta2)
|
||||||
rspec-support (= 3.0.0.beta2)
|
rspec-support (= 3.0.0.beta2)
|
||||||
|
|
@ -264,6 +264,7 @@ DEPENDENCIES
|
||||||
d3_rails
|
d3_rails
|
||||||
devise
|
devise
|
||||||
factory_girl_rails
|
factory_girl_rails
|
||||||
|
formtastic (~> 2.3.0.rc3)
|
||||||
formtastic-bootstrap
|
formtastic-bootstrap
|
||||||
gravtastic
|
gravtastic
|
||||||
haml-rails
|
haml-rails
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ class Admin::ConferenceController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@conference = Conference.find_all_by_short_title(params[:id]).first
|
@conference = Conference.find_by(short_title: params[:id])
|
||||||
@conference.update_attributes(params[:conference])
|
@conference.update_attributes(params[:conference])
|
||||||
flash[:notice] = "Updated Conference"
|
flash[:notice] = "Updated Conference"
|
||||||
redirect_to(admin_conference_path(:id => @conference.short_title), :notice => 'Conference was successfully updated.')
|
redirect_to(admin_conference_path(:id => @conference.short_title), :notice => 'Conference was successfully updated.')
|
||||||
|
|
@ -31,7 +31,7 @@ class Admin::ConferenceController < ApplicationController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@conferences = Conference.all
|
@conferences = Conference.all
|
||||||
@conference = Conference.find_all_by_short_title(params[:id]).first
|
@conference = Conference.find_by(short_title: params[:id])
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.json { render :json => @conference.to_json }
|
format.json { render :json => @conference.to_json }
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ class Admin::DifficultyLevelsController < ApplicationController
|
||||||
before_filter :verify_organizer
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,19 @@ class Admin::QuestionsController < ApplicationController
|
||||||
before_filter :verify_organizer
|
before_filter :verify_organizer
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
@questions = Question.where(:global => true).all | Question.where(:conference_id => @conference.id)
|
@questions = Question.where(:global => true).all | Question.where(:conference_id => @conference.id)
|
||||||
@questions_conference = @conference.questions
|
@questions_conference = @conference.questions
|
||||||
@new_question = @conference.questions.new
|
@new_question = @conference.questions.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
@new_question = @conference.questions.new
|
@new_question = @conference.questions.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
@question = @conference.questions.new(params[:question])
|
@question = @conference.questions.new(params[:question])
|
||||||
@question.conference_id = @conference.id
|
@question.conference_id = @conference.id
|
||||||
|
|
||||||
|
|
@ -30,7 +30,7 @@ class Admin::QuestionsController < ApplicationController
|
||||||
|
|
||||||
# GET questions/1/edit
|
# GET questions/1/edit
|
||||||
def edit
|
def edit
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
@question = Question.find(params[:id])
|
@question = Question.find(params[:id])
|
||||||
|
|
||||||
if @question.global == true && !has_role?(current_user, "Admin")
|
if @question.global == true && !has_role?(current_user, "Admin")
|
||||||
|
|
@ -41,7 +41,7 @@ class Admin::QuestionsController < ApplicationController
|
||||||
# PUT questions/1
|
# PUT questions/1
|
||||||
def update
|
def update
|
||||||
|
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
@question = Question.find(params[:id])
|
@question = Question.find(params[:id])
|
||||||
|
|
||||||
if @question.update_attributes(params[:question])
|
if @question.update_attributes(params[:question])
|
||||||
|
|
@ -53,7 +53,7 @@ class Admin::QuestionsController < ApplicationController
|
||||||
|
|
||||||
# Update questions used for the conference
|
# Update questions used for the conference
|
||||||
def update_conference
|
def update_conference
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
|
|
||||||
if @conference.update_attributes(params[:conference])
|
if @conference.update_attributes(params[:conference])
|
||||||
redirect_to(admin_conference_questions_path(:conference_id => @conference.short_title), :notice => "Questions for #{@conference.short_title} successfully updated.")
|
redirect_to(admin_conference_questions_path(:conference_id => @conference.short_title), :notice => "Questions for #{@conference.short_title} successfully updated.")
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,11 @@ class Admin::RegistrationsController < ApplicationController
|
||||||
@person = Person.new
|
@person = Person.new
|
||||||
@registration = @person.registrations.new
|
@registration = @person.registrations.new
|
||||||
@supporter_registration = @conference.supporter_registrations.new
|
@supporter_registration = @conference.supporter_registrations.new
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
email = params[:registration][:person].delete(:user)[:email]
|
email = params[:registration][:person].delete(:user)[:email]
|
||||||
@person = Person.find_by_email email
|
@person = Person.find_by_email email
|
||||||
@registration = nil
|
@registration = nil
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
class Admin::VolunteersController < ApplicationController
|
class Admin::VolunteersController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
render :index
|
render :index
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
if @conference.use_vpositions
|
if @conference.use_vpositions
|
||||||
@volunteers = @conference.registrations.joins(:vchoices).uniq
|
@volunteers = @conference.registrations.joins(:vchoices).uniq
|
||||||
else
|
else
|
||||||
|
|
@ -14,7 +14,7 @@ class Admin::VolunteersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
begin
|
begin
|
||||||
@conference.update_attributes!(params[:conference])
|
@conference.update_attributes!(params[:conference])
|
||||||
redirect_to(admin_conference_volunteers_info_path(:conference_id => params[:conference_id]), :notice => "Volunteering options were successfully updated.")
|
redirect_to(admin_conference_volunteers_info_path(:conference_id => params[:conference_id]), :notice => "Volunteering options were successfully updated.")
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class ApplicationController < ActionController::Base
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ class ConferenceRegistrationController < ApplicationController
|
||||||
|
|
||||||
def register
|
def register
|
||||||
# TODO Figure out how to change the route's id from :id to :conference_id
|
# TODO Figure out how to change the route's id from :id to :conference_id
|
||||||
@conference = Conference.find_all_by_short_title(params[:id]).first
|
@conference = Conference.find_by(short_title: params[:id])
|
||||||
@workshops = @conference.events.where("require_registration = ? AND state LIKE ?", true, 'confirmed')
|
@workshops = @conference.events.where("require_registration = ? AND state LIKE ?", true, 'confirmed')
|
||||||
@person = current_user.person
|
@person = current_user.person
|
||||||
if @person.first_name.blank? || @person.last_name.blank?
|
if @person.first_name.blank? || @person.last_name.blank?
|
||||||
|
|
@ -24,7 +24,7 @@ class ConferenceRegistrationController < ApplicationController
|
||||||
|
|
||||||
# TODO this is ugly
|
# TODO this is ugly
|
||||||
def update
|
def update
|
||||||
conference = Conference.find_all_by_short_title(params[:id]).first
|
conference = Conference.find_by(short_title: params[:id])
|
||||||
person = current_user.person
|
person = current_user.person
|
||||||
registration = person.registrations.where(:conference_id => conference.id).first
|
registration = person.registrations.where(:conference_id => conference.id).first
|
||||||
update_registration = true
|
update_registration = true
|
||||||
|
|
@ -80,7 +80,7 @@ class ConferenceRegistrationController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def unregister
|
def unregister
|
||||||
conference = Conference.find_all_by_short_title(params[:id]).first
|
conference = Conference.find_by(short_title: params[:id])
|
||||||
person = current_user.person
|
person = current_user.person
|
||||||
registration = person.registrations.where(:conference_id => conference.id).first
|
registration = person.registrations.where(:conference_id => conference.id).first
|
||||||
registration.destroy
|
registration.destroy
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ class ProposalController < ApplicationController
|
||||||
@person = current_user.person if current_user
|
@person = current_user.person if current_user
|
||||||
#FIXME: @conference also comes from verify_user, but we need setup also in show
|
#FIXME: @conference also comes from verify_user, but we need setup also in show
|
||||||
# which can be accessed anonymusly
|
# which can be accessed anonymusly
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
@url = conference_proposal_index_path(@conference.short_title)
|
@url = conference_proposal_index_path(@conference.short_title)
|
||||||
@event_types = @conference.event_types
|
@event_types = @conference.event_types
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue