Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
Upgrade to Rails 5.0
Browse files Browse the repository at this point in the history
Remove protected_attributes and use strong_params

Update to gems used

Fix issues with some templates

Update authlogic to work with rails 5.0
  • Loading branch information
cheeyeo committed Aug 22, 2016
1 parent 941d0e8 commit 07363cb
Show file tree
Hide file tree
Showing 47 changed files with 335 additions and 200 deletions.
16 changes: 8 additions & 8 deletions Gemfile
@@ -1,24 +1,22 @@
source 'https://rubygems.org'

gem 'unicorn'
gem 'rails', '~> 4.2', '>= 4.2.7.1'
gem 'pg', '~> 0.15'
gem 'rails', '5.0.0'
gem 'pg', '~> 0.18'

gem 'jquery-rails'
gem 'jquery-datatables-rails', git: 'https://github.com/rweng/jquery-datatables-rails.git'
#gem 'postgres_ext', :git => 'git://github.com/dockyard/postgres_ext.git'

gem 'kissfft'
gem 'rex', '~> 2.0.10'

gem 'bootstrap-sass', '>= 3.2.0'
gem 'sass-rails', '~> 5.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'coffee-rails', '~> 4.2'
gem 'uglifier', '>= 1.3.0'
gem 'protected_attributes', '~> 1.0.7'
gem 'autoprefixer-rails'

gem 'authlogic', '>= 3.4.0'
gem 'authlogic', git: "https://github.com/binarylogic/authlogic.git"
gem 'rails-settings-cached', '>= 0.4.1'
gem "breadcrumbs_on_rails"

Expand All @@ -43,13 +41,13 @@ group :development do
gem 'rails_layout'
gem 'guard-livereload', '~> 2.4', require: false
gem 'annotate'
gem 'web-console', '~> 2.0'
gem 'web-console'
end
group :development, :test do
gem 'factory_girl_rails'
gem 'faker'
gem 'rspec-rails'
gem 'byebug'
gem 'byebug', platform: :mri
end
group :test do
gem 'capybara'
Expand All @@ -58,3 +56,5 @@ group :test do
gem 'selenium-webdriver'
gem 'shoulda-matchers', '2.8'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
138 changes: 73 additions & 65 deletions Gemfile.lock
@@ -1,3 +1,13 @@
GIT
remote: https://github.com/binarylogic/authlogic.git
revision: c74344b705f0637f7f0ee0489a6832b0b5a851b9
specs:
authlogic (3.4.6)
activerecord (>= 3.2, < 5.1)
activesupport (>= 3.2, < 5.1)
request_store (~> 1.0)
scrypt (>= 1.2, < 4.0)

GIT
remote: https://github.com/hdm/reportable.git
revision: 073bc1657ee301f4c961f14247ef1a58cf38bd1f
Expand All @@ -19,51 +29,48 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.7.1)
actionpack (= 4.2.7.1)
actionview (= 4.2.7.1)
activejob (= 4.2.7.1)
actioncable (5.0.0)
actionpack (= 5.0.0)
nio4r (~> 1.2)
websocket-driver (~> 0.6.1)
actionmailer (5.0.0)
actionpack (= 5.0.0)
actionview (= 5.0.0)
activejob (= 5.0.0)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.7.1)
actionview (= 4.2.7.1)
activesupport (= 4.2.7.1)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-dom-testing (~> 2.0)
actionpack (5.0.0)
actionview (= 5.0.0)
activesupport (= 5.0.0)
rack (~> 2.0)
rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.7.1)
activesupport (= 4.2.7.1)
actionview (5.0.0)
activesupport (= 5.0.0)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.7.1)
activesupport (= 4.2.7.1)
globalid (>= 0.3.0)
activemodel (4.2.7.1)
activesupport (= 4.2.7.1)
builder (~> 3.1)
activerecord (4.2.7.1)
activemodel (= 4.2.7.1)
activesupport (= 4.2.7.1)
arel (~> 6.0)
activesupport (4.2.7.1)
activejob (5.0.0)
activesupport (= 5.0.0)
globalid (>= 0.3.6)
activemodel (5.0.0)
activesupport (= 5.0.0)
activerecord (5.0.0)
activemodel (= 5.0.0)
activesupport (= 5.0.0)
arel (~> 7.0)
activesupport (5.0.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
annotate (2.7.1)
activerecord (>= 3.2, < 6.0)
rake (>= 10.4, < 12.0)
arel (6.0.3)
authlogic (3.4.6)
activerecord (>= 3.2)
activesupport (>= 3.2)
request_store (~> 1.0)
scrypt (>= 1.2, < 3.0)
arel (7.1.1)
autoprefixer-rails (6.4.0.2)
execjs
binding_of_caller (0.7.2)
Expand All @@ -84,9 +91,9 @@ GEM
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.1)
coffee-rails (4.1.1)
coffee-rails (4.2.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x)
railties (>= 4.0.0, < 5.2.x)
coffee-script (2.4.1)
coffee-script-source
execjs
Expand Down Expand Up @@ -157,7 +164,7 @@ GEM
thor (>= 0.14, < 2.0)
jsobfu (0.4.1)
rkelly-remix (= 0.0.6)
json (1.8.3)
json (2.0.2)
kgio (2.10.0)
kissfft (0.0.2)
launchy (2.4.3)
Expand All @@ -181,6 +188,7 @@ GEM
minitest (5.9.0)
multi_json (1.12.1)
nenv (0.3.0)
nio4r (1.2.1)
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
Expand All @@ -189,41 +197,38 @@ GEM
shellany (~> 0.0)
pg (0.18.4)
pkg-config (1.1.7)
protected_attributes (1.0.9)
activemodel (>= 4.0.1, < 5.0)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
psych_shield (0.0.4)
rack (1.6.4)
rack (2.0.1)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.7.1)
actionmailer (= 4.2.7.1)
actionpack (= 4.2.7.1)
actionview (= 4.2.7.1)
activejob (= 4.2.7.1)
activemodel (= 4.2.7.1)
activerecord (= 4.2.7.1)
activesupport (= 4.2.7.1)
rails (5.0.0)
actioncable (= 5.0.0)
actionmailer (= 5.0.0)
actionpack (= 5.0.0)
actionview (= 5.0.0)
activejob (= 5.0.0)
activemodel (= 5.0.0)
activerecord (= 5.0.0)
activesupport (= 5.0.0)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.7.1)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
activesupport (>= 4.2.0.beta, < 5.0)
railties (= 5.0.0)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.1)
activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails-settings-cached (0.6.5)
rails (>= 4.2.0)
rails_layout (1.0.29)
railties (4.2.7.1)
actionpack (= 4.2.7.1)
activesupport (= 4.2.7.1)
railties (5.0.0)
actionpack (= 5.0.0)
activesupport (= 5.0.0)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.17.0)
Expand Down Expand Up @@ -274,8 +279,8 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
scrypt (2.1.1)
ffi-compiler (>= 0.0.2)
scrypt (3.0.3)
ffi-compiler (>= 1.0.0)
rake
selenium-webdriver (2.53.4)
childprocess (~> 0.5)
Expand Down Expand Up @@ -311,6 +316,9 @@ GEM
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
websocket (1.2.3)
websocket-driver (0.6.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
will_paginate (3.1.0)
will_paginate-bootstrap (1.0.1)
will_paginate (>= 3.0.3)
Expand All @@ -322,13 +330,13 @@ PLATFORMS

DEPENDENCIES
annotate
authlogic (>= 3.4.0)
authlogic!
autoprefixer-rails
bootstrap-sass (>= 3.2.0)
breadcrumbs_on_rails
byebug
capybara
coffee-rails (~> 4.1.0)
coffee-rails (~> 4.2)
database_cleaner
dynamic_form (>= 1.1.4)
factory_girl_rails
Expand All @@ -344,10 +352,9 @@ DEPENDENCIES
jquery-rails
kissfft
launchy
pg (~> 0.15)
protected_attributes (~> 1.0.7)
pg (~> 0.18)
psych_shield
rails (~> 4.2, >= 4.2.7.1)
rails (= 5.0.0)
rails-settings-cached (>= 0.4.1)
rails_layout
reportable!
Expand All @@ -358,9 +365,10 @@ DEPENDENCIES
selenium-webdriver
shoulda-matchers (= 2.8)
therubyracer
tzinfo-data
uglifier (>= 1.3.0)
unicorn
web-console (~> 2.0)
web-console
will_paginate (~> 3.0)
will_paginate-bootstrap

Expand Down
3 changes: 3 additions & 0 deletions app/assets/config/manifest.js
@@ -0,0 +1,3 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
Empty file added app/assets/images/.keep
Empty file.
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
@@ -1,9 +1,9 @@
class ApplicationController < ActionController::Base
protect_from_forgery
protect_from_forgery with: :exception
helper :all

helper_method :current_user_session, :current_user
before_filter :require_user, :load_project
before_action :require_user, :load_project
add_breadcrumb :projects, :root_path

include ActionView::Helpers::NumberHelper
Expand Down
Empty file added app/controllers/concerns/.keep
Empty file.
7 changes: 6 additions & 1 deletion app/controllers/jobs_controller.rb
Expand Up @@ -156,7 +156,7 @@ def purge_calls
end

def dialer
@job = Job.new(params[:job])
@job = Job.new(job_params)
@job.created_by = @current_user.login
@job.task = 'dialer'
@job.range.to_s.gsub!(/[^0-9X:,\n]/, '')
Expand Down Expand Up @@ -343,4 +343,9 @@ def destroy
end
end

private

def job_params
params.require(:job).permit(:project_id, :range, :range_file, :seconds, :lines, :cid_mask)
end
end
10 changes: 8 additions & 2 deletions app/controllers/projects_controller.rb
Expand Up @@ -96,7 +96,7 @@ def edit
end

def create
@new_project = Project.new(params[:project])
@new_project = Project.new(project_params)
@new_project.created_by = current_user.login

respond_to do |format|
Expand All @@ -114,7 +114,7 @@ def update
@project = Project.find(params[:id])

respond_to do |format|
if @project.update_attributes(params[:project])
if @project.update_attributes(project_params)
format.html { redirect_to projects_path }
format.xml { head :ok }
else
Expand All @@ -133,4 +133,10 @@ def destroy
format.xml { head :ok }
end
end

private

def project_params
params.require(:project).permit(:name, :description)
end
end

0 comments on commit 07363cb

Please sign in to comment.