Skip to content

Commit

Permalink
Upgrade to Rails 5.2 (#171)
Browse files Browse the repository at this point in the history
* Upgrade to rails 5.2

* Upgrade to Rails 5.2 and remove schema_validations gem
  • Loading branch information
indocomsoft committed Nov 14, 2018
1 parent 5a5ba17 commit 7f7f194
Show file tree
Hide file tree
Showing 36 changed files with 276 additions and 254 deletions.
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ source 'https://rubygems.org'
# Ruby version
ruby '2.5.1'
# Rails version
gem 'rails', '~> 5.1.0'
gem 'rails', '~> 5.2'
# Use postgres as database
gem 'pg', '< 2'
gem 'pg'
# Use Puma as the app server
gem 'puma'
# For Travis CI
gem 'rake', group: :test
# Make loading large Ruby/Rails apps faster
gem 'bootsnap', require: false

### END BASICS

Expand Down Expand Up @@ -45,8 +47,6 @@ end

### UTILITIES

# Schema Validations: to maintin referential integrity in database and models
gem 'schema_validations'
# Environment variables
gem 'dotenv-rails', require: 'dotenv/rails-now'
# Mailgun
Expand Down
128 changes: 57 additions & 71 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,52 +1,58 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.1.6)
actionpack (= 5.1.6)
actioncable (5.2.1)
actionpack (= 5.2.1)
nio4r (~> 2.0)
websocket-driver (~> 0.6.1)
actionmailer (5.1.6)
actionpack (= 5.1.6)
actionview (= 5.1.6)
activejob (= 5.1.6)
websocket-driver (>= 0.6.1)
actionmailer (5.2.1)
actionpack (= 5.2.1)
actionview (= 5.2.1)
activejob (= 5.2.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.1.6)
actionview (= 5.1.6)
activesupport (= 5.1.6)
actionpack (5.2.1)
actionview (= 5.2.1)
activesupport (= 5.2.1)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.1.6)
activesupport (= 5.1.6)
actionview (5.2.1)
activesupport (= 5.2.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.1.6)
activesupport (= 5.1.6)
activejob (5.2.1)
activesupport (= 5.2.1)
globalid (>= 0.3.6)
activemodel (5.1.6)
activesupport (= 5.1.6)
activerecord (5.1.6)
activemodel (= 5.1.6)
activesupport (= 5.1.6)
arel (~> 8.0)
activesupport (5.1.6)
activemodel (5.2.1)
activesupport (= 5.2.1)
activerecord (5.2.1)
activemodel (= 5.2.1)
activesupport (= 5.2.1)
arel (>= 9.0)
activestorage (5.2.1)
actionpack (= 5.2.1)
activerecord (= 5.2.1)
marcel (~> 0.3.1)
activesupport (5.2.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
annotate (2.7.4)
activerecord (>= 3.2, < 6.0)
rake (>= 10.4, < 13.0)
arel (8.0.0)
arel (9.0.0)
ast (2.4.0)
autoprefixer-rails (9.1.4)
autoprefixer-rails (9.3.1)
execjs
bcrypt (3.1.12)
bindex (0.5.0)
bootsnap (1.3.2)
msgpack (~> 1.0)
bootstrap (4.1.3)
autoprefixer-rails (>= 6.0.3)
popper_js (>= 1.12.9, < 2)
Expand Down Expand Up @@ -100,7 +106,6 @@ GEM
domain_name (~> 0.5)
i18n (1.1.1)
concurrent-ruby (~> 1.0)
its-it (1.3.0)
jaro_winkler (1.5.1)
jquery-rails (4.3.3)
rails-dom-testing (>= 1, < 3)
Expand All @@ -110,7 +115,6 @@ GEM
railties (>= 3.1.0)
turbolinks
json (2.1.0)
key_struct (0.4.2)
libv8 (6.7.288.46.1)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand All @@ -123,17 +127,19 @@ GEM
mini_mime (>= 0.1.1)
mailgun-ruby (1.1.11)
rest-client (~> 2.0.2)
method_source (0.9.0)
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (0.9.2)
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2018.0812)
mimemagic (0.3.2)
mini_mime (1.0.1)
mini_portile2 (2.3.0)
mini_racer (0.2.4)
libv8 (>= 6.3)
minitest (5.11.3)
modware (0.1.3)
key_struct (~> 0.4)
msgpack (1.2.4)
netrc (0.11.0)
nio4r (2.3.1)
nokogiri (1.8.5)
Expand All @@ -153,17 +159,18 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.1.6)
actioncable (= 5.1.6)
actionmailer (= 5.1.6)
actionpack (= 5.1.6)
actionview (= 5.1.6)
activejob (= 5.1.6)
activemodel (= 5.1.6)
activerecord (= 5.1.6)
activesupport (= 5.1.6)
rails (5.2.1)
actioncable (= 5.2.1)
actionmailer (= 5.2.1)
actionpack (= 5.2.1)
actionview (= 5.2.1)
activejob (= 5.2.1)
activemodel (= 5.2.1)
activerecord (= 5.2.1)
activestorage (= 5.2.1)
activesupport (= 5.2.1)
bundler (>= 1.3.0)
railties (= 5.1.6)
railties (= 5.2.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
Expand All @@ -180,12 +187,12 @@ GEM
rails (>= 3.1)
rest-client (~> 2.0)
rubyzip (~> 1)
railties (5.1.6)
actionpack (= 5.1.6)
activesupport (= 5.1.6)
railties (5.2.1)
actionpack (= 5.2.1)
activesupport (= 5.2.1)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
rake (12.3.1)
rb-fsevent (0.10.3)
Expand Down Expand Up @@ -226,11 +233,11 @@ GEM
unicode-display_width (~> 1.4.0)
rubocop-rspec (1.30.1)
rubocop (>= 0.60.0)
ruby-graphviz (1.2.3)
ruby-graphviz (1.2.4)
ruby-progressbar (1.10.0)
ruby_dep (1.5.0)
rubyzip (1.2.2)
sass (3.6.0)
sass (3.7.2)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand All @@ -244,26 +251,6 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
schema_monkey (2.1.5)
activerecord (>= 4.2)
modware (~> 0.1)
schema_plus_columns (0.3.0)
activerecord (>= 4.2, < 5.3)
its-it (~> 1.2)
schema_plus_core
schema_plus_indexes (~> 0.2)
schema_plus_core (2.2.0)
activerecord (~> 5.0)
its-it (~> 1.2)
schema_monkey (~> 2.1)
schema_plus_indexes (0.3.0)
activerecord (>= 4.2, < 5.2)
its-it (~> 1.2)
schema_plus_core
schema_validations (2.3.0)
activerecord (~> 5.0)
schema_plus_columns
valuable
scss_lint (0.57.1)
rake (>= 0.9, < 13)
sass (~> 3.5, >= 3.5.5)
Expand All @@ -285,12 +272,12 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
term-ansicolor (1.6.0)
term-ansicolor (1.7.0)
tins (~> 1.0)
thor (0.19.4)
thread_safe (0.3.6)
tilt (2.0.8)
tins (1.16.3)
tins (1.19.0)
traceroute (0.8.0)
rails (>= 3.0.0)
turbolinks (5.2.0)
Expand All @@ -306,15 +293,14 @@ GEM
unicode-display_width (1.4.0)
uniform_notifier (1.12.1)
useragent (0.16.10)
valuable (0.9.14)
warden (1.2.7)
rack (>= 1.0)
web-console (3.7.0)
actionview (>= 5.0)
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
websocket-driver (0.6.5)
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)

Expand All @@ -323,6 +309,7 @@ PLATFORMS

DEPENDENCIES
annotate
bootsnap
bootstrap
brakeman
browser_details
Expand All @@ -339,11 +326,11 @@ DEPENDENCIES
listen
mailgun-ruby (~> 1.1.11)
mini_racer
pg (< 2)
pg
puma
rack-mini-profiler
rack-protection
rails (~> 5.1.0)
rails (~> 5.2)
rails-erd
rails_real_favicon (>= 0.0.7)
rake
Expand All @@ -352,7 +339,6 @@ DEPENDENCIES
rubocop
rubocop-rspec
sassc-rails
schema_validations
scss_lint
shoulda-matchers (= 4.0.0rc1)
sitemap_generator
Expand Down
4 changes: 3 additions & 1 deletion app/models/announcement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
#
# Table name: announcements
#
# id :integer not null, primary key
# id :bigint(8) not null, primary key
# subject :text not null
# details :text not null
# created_at :datetime not null
# updated_at :datetime not null
#

class Announcement < ApplicationRecord
validates :subject, presence: true
validates :details, presence: true
end
8 changes: 4 additions & 4 deletions app/models/availability.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# frozen_string_literal: true

# rubocop:disable Metrics/LineLength

# == Schema Information
#
# Table name: availabilities
#
# id :integer not null, primary key
# user_id :integer
# id :bigint(8) not null, primary key
# user_id :bigint(8)
# day :integer not null
# time_range_id :integer
# time_range_id :bigint(8)
# created_at :datetime not null
# updated_at :datetime not null
# status :boolean not null
Expand All @@ -31,4 +30,5 @@ class Availability < ApplicationRecord
belongs_to :user
belongs_to :time_range
enum day: Date::DAYNAMES
validates :day, presence: true
end
6 changes: 3 additions & 3 deletions app/models/duty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#
# Table name: duties
#
# id :integer not null, primary key
# user_id :integer
# timeslot_id :integer
# id :bigint(8) not null, primary key
# user_id :bigint(8)
# timeslot_id :bigint(8)
# date :date
# created_at :datetime not null
# updated_at :datetime not null
Expand Down
2 changes: 1 addition & 1 deletion app/models/place.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Table name: places
#
# id :integer not null, primary key
# id :bigint(8) not null, primary key
# name :string
# created_at :datetime not null
# updated_at :datetime not null
Expand Down
15 changes: 8 additions & 7 deletions app/models/problem_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
#
# Table name: problem_reports
#
# id :integer not null, primary key
# id :bigint(8) not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# computer_number :string
# description :text
# computer_number :string not null
# description :text not null
# is_critical :boolean
# is_fixed :boolean default(FALSE)
# is_fixable :boolean default(TRUE)
# is_fixed :boolean default(FALSE), not null
# is_fixable :boolean default(TRUE), not null
# remarks :text
# place_id :integer
# is_blocked :boolean default(FALSE)
# is_blocked :boolean default(FALSE), not null
# reporter_user_id :integer
# last_update_user_id :integer
#
Expand All @@ -26,7 +26,8 @@
#

class ProblemReport < ApplicationRecord
validates :computer_number, :place_id, :description, presence: true
validates :computer_number, presence: true
validates :description, presence: true
belongs_to :reporter_user, class_name: 'User', optional: true,
inverse_of: :reported_problem_reports
belongs_to :last_update_user, class_name: 'User', optional: true,
Expand Down

0 comments on commit 7f7f194

Please sign in to comment.