Upgrade to Rails 5

This commit is contained in:
Georg Gadinger 2020-04-19 00:59:18 +02:00
parent e52e44eff2
commit 3e7497a144
41 changed files with 573 additions and 395 deletions

19
Gemfile
View File

@ -1,24 +1,24 @@
source 'https://rubygems.org' source 'https://rubygems.org'
source 'https://rails-assets.org' source 'https://rails-assets.org'
gem 'rails', '~> 4.2.11', '>= 4.2.11.1' gem 'rails', '~> 5.0.7', '>= 5.0.7.2'
gem 'rails-i18n' gem 'rails-i18n', '~> 5.0'
gem 'i18n-js', '= 3.0.0.rc10' gem 'i18n-js', '= 3.0.0.rc10'
gem 'pg' gem 'pg'
gem 'sass-rails', '~> 4.0.3' gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0' gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0' gem 'coffee-rails', '~> 4.1'
gem 'jquery-rails' gem 'jquery-rails'
gem 'turbolinks', '~> 2.5.3' gem 'turbolinks', '~> 2.5.3'
gem 'jquery-turbolinks' gem 'jquery-turbolinks'
gem 'jbuilder', '~> 2.2.4' gem 'jbuilder', '~> 2.10'
gem 'sdoc', '~> 0.4.1', group: :doc gem 'sdoc', '~> 0.4.1', group: :doc
gem 'bcrypt', '~> 3.1.7' gem 'bcrypt', '~> 3.1.7'
gem 'haml', '~> 4.0' gem 'haml', '~> 5.0'
gem 'bootstrap-sass', '~> 3.4.0' gem 'bootstrap-sass', '~> 3.4.0'
gem 'bootswatch-rails' gem 'bootswatch-rails'
gem 'sweetalert-rails' gem 'sweetalert-rails'
@ -30,7 +30,7 @@ gem 'devise-async', git: "https://github.com/mhfs/devise-async.git", ref: "devis
gem 'bootstrap_form' gem 'bootstrap_form'
gem 'font-kit-rails' gem 'font-kit-rails'
gem 'nprogress-rails' gem 'nprogress-rails'
gem 'font-awesome-rails', '~> 4.3.0.0' gem 'font-awesome-rails', '~> 4.7.0'
gem 'rails-assets-growl' gem 'rails-assets-growl'
gem 'rails-assets-jquery', '~> 2.2.0' gem 'rails-assets-jquery', '~> 2.2.0'
gem "paperclip", "~> 4.2" gem "paperclip", "~> 4.2"
@ -51,8 +51,7 @@ gem 'rails_admin'
gem 'pghero' gem 'pghero'
gem 'newrelic_rpm' gem 'newrelic_rpm'
gem 'sidekiq' gem 'sidekiq', "< 6" # remove version constraint once we have redis 5
gem 'sinatra', require: false
gem 'questiongenerator', git: 'https://github.com/retrospring/questiongenerator.git' gem 'questiongenerator', git: 'https://github.com/retrospring/questiongenerator.git'
@ -97,7 +96,7 @@ end
group :development, :test do group :development, :test do
gem 'rake' gem 'rake'
gem 'puma' gem 'puma'
gem 'rspec-rails', '~> 3.5' gem 'rspec-rails', '~> 3.9'
gem 'factory_girl_rails', require: false gem 'factory_girl_rails', require: false
gem 'faker' gem 'faker'
gem 'capybara' gem 'capybara'

View File

@ -16,103 +16,112 @@ GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
remote: https://rails-assets.org/ remote: https://rails-assets.org/
specs: specs:
CFPropertyList (2.3.5) CFPropertyList (2.3.6)
actionmailer (4.2.11.1) actioncable (5.0.7.2)
actionpack (= 4.2.11.1) actionpack (= 5.0.7.2)
actionview (= 4.2.11.1) nio4r (>= 1.2, < 3.0)
activejob (= 4.2.11.1) websocket-driver (~> 0.6.1)
actionmailer (5.0.7.2)
actionpack (= 5.0.7.2)
actionview (= 5.0.7.2)
activejob (= 5.0.7.2)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5) rails-dom-testing (~> 2.0)
actionpack (4.2.11.1) actionpack (5.0.7.2)
actionview (= 4.2.11.1) actionview (= 5.0.7.2)
activesupport (= 4.2.11.1) activesupport (= 5.0.7.2)
rack (~> 1.6) rack (~> 2.0)
rack-test (~> 0.6.2) rack-test (~> 0.6.3)
rails-dom-testing (~> 1.0, >= 1.0.5) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.11.1) actionview (5.0.7.2)
activesupport (= 4.2.11.1) activesupport (= 5.0.7.2)
builder (~> 3.1) builder (~> 3.1)
erubis (~> 2.7.0) erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3) rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (4.2.11.1) activejob (5.0.7.2)
activesupport (= 4.2.11.1) activesupport (= 5.0.7.2)
globalid (>= 0.3.0) globalid (>= 0.3.6)
activemodel (4.2.11.1) activemodel (5.0.7.2)
activesupport (= 4.2.11.1) activesupport (= 5.0.7.2)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1) builder (~> 3.1)
activerecord (4.2.11.1) activerecord (5.0.7.2)
activemodel (= 4.2.11.1) activemodel (= 5.0.7.2)
activesupport (= 4.2.11.1) activesupport (= 5.0.7.2)
arel (~> 6.0) arel (~> 7.0)
activesupport (4.2.11.1) activesupport (5.0.7.2)
i18n (~> 0.7) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1) minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1) tzinfo (~> 1.1)
addressable (2.5.1) addressable (2.7.0)
public_suffix (~> 2.0, >= 2.0.2) public_suffix (>= 2.0.2, < 5.0)
airbrussh (1.1.2) airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0) sshkit (>= 1.6.1, != 1.7.0)
arel (6.0.4) arel (7.1.4)
autoprefixer-rails (9.5.0) autoprefixer-rails (9.7.6)
execjs execjs
bcrypt (3.1.12) bcrypt (3.1.13)
better_errors (2.1.1) better_errors (2.6.0)
coderay (>= 1.0.0) coderay (>= 1.0.0)
erubis (>= 2.6.6) erubi (>= 1.0.0)
rack (>= 0.9.0) rack (>= 0.9.0)
binding_of_caller (0.7.2) binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1) debug_inspector (>= 0.0.1)
bootstrap-sass (3.4.1) bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1) autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0) sassc (>= 2.0.0)
bootstrap3-datetimepicker-rails (4.7.14) bootstrap3-datetimepicker-rails (4.7.14)
momentjs-rails (>= 2.8.1) momentjs-rails (>= 2.8.1)
bootstrap_form (2.6.0) bootstrap_form (4.4.0)
actionpack (>= 5.0)
activemodel (>= 5.0)
bootswatch-rails (3.3.5) bootswatch-rails (3.3.5)
railties (>= 3.1) railties (>= 3.1)
brakeman (3.6.1) brakeman (4.8.1)
buftok (0.2.0) buftok (0.2.0)
builder (3.2.3) builder (3.2.4)
byebug (9.0.6) byebug (11.1.2)
capistrano (3.8.0) capistrano (3.13.0)
airbrussh (>= 1.0.0) airbrussh (>= 1.0.0)
i18n i18n
rake (>= 10.0.0) rake (>= 10.0.0)
sshkit (>= 1.9.0) sshkit (>= 1.9.0)
capistrano-bundler (1.2.0) capistrano-bundler (1.6.0)
capistrano (~> 3.1) capistrano (~> 3.1)
sshkit (~> 1.2) capistrano-rails (1.4.0)
capistrano-rails (1.2.3)
capistrano (~> 3.1) capistrano (~> 3.1)
capistrano-bundler (~> 1.1) capistrano-bundler (~> 1.1)
capybara (2.13.0) capybara (3.32.1)
addressable addressable
mime-types (>= 1.16) mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3) nokogiri (~> 1.8)
rack (>= 1.0.0) rack (>= 1.6.0)
rack-test (>= 0.5.4) rack-test (>= 0.6.3)
xpath (~> 2.0) regexp_parser (~> 1.5)
xpath (~> 3.2)
climate_control (0.2.0) climate_control (0.2.0)
cliver (0.3.2) cliver (0.3.2)
cocaine (0.5.8) cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0) climate_control (>= 0.0.3, < 1.0)
coderay (1.1.1) coderay (1.1.2)
coffee-rails (4.1.1) coffee-rails (4.2.2)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x) railties (>= 4.0.0)
coffee-script (2.4.1) coffee-script (2.4.1)
coffee-script-source coffee-script-source
execjs execjs
coffee-script-source (1.12.2) coffee-script-source (1.12.2)
colorize (0.8.1) colorize (0.8.1)
concurrent-ruby (1.0.5) concurrent-ruby (1.1.6)
connection_pool (2.2.1) connection_pool (2.2.2)
crass (1.0.4) crass (1.0.6)
database_cleaner (1.5.3) database_cleaner (1.8.4)
debug_inspector (0.0.2) debug_inspector (0.0.3)
delayed_paperclip (3.0.1) delayed_paperclip (3.0.1)
activejob (>= 4.2) activejob (>= 4.2)
paperclip (>= 3.3) paperclip (>= 3.3)
@ -122,44 +131,52 @@ GEM
railties (>= 4.1.0) railties (>= 4.1.0)
responders responders
warden (~> 1.2.3) warden (~> 1.2.3)
devise-i18n (1.1.2) devise-i18n (1.9.1)
devise (>= 4.7.1)
diff-lcs (1.3) diff-lcs (1.3)
docile (1.1.5) docile (1.3.2)
domain_name (0.5.20170223) domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0) unf (>= 0.0.5, < 1.0.0)
dry-inflector (0.2.0)
equalizer (0.0.11) equalizer (0.0.11)
erubi (1.9.0)
erubis (2.7.0) erubis (2.7.0)
excon (0.73.0) excon (0.73.0)
execjs (2.7.0) execjs (2.7.0)
factory_girl (4.8.0) factory_girl (4.9.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
factory_girl_rails (4.8.0) factory_girl_rails (4.9.0)
factory_girl (~> 4.8.0) factory_girl (~> 4.9.0)
railties (>= 3.0.0) railties (>= 3.0.0)
fake_email_validator (1.0.11) fake_email_validator (1.0.11)
activemodel activemodel
mail mail
faker (1.7.3) faker (2.2.1)
i18n (~> 0.5) i18n (>= 0.8)
faraday (0.11.0) faraday (0.9.2)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
faraday_middleware (0.11.0.1) faraday_middleware (0.9.2)
faraday (>= 0.7.4, < 1.0) faraday (>= 0.7.4, < 0.10)
ffi (1.10.0) ffi (1.12.2)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
fission (0.5.0) fission (0.5.0)
CFPropertyList (~> 2.2) CFPropertyList (~> 2.2)
fog (1.40.0) fog (1.41.0)
fog-aliyun (>= 0.1.0) fog-aliyun (>= 0.1.0)
fog-atmos fog-atmos
fog-aws (>= 0.6.0) fog-aws (>= 0.6.0)
fog-brightbox (~> 0.4) fog-brightbox (~> 0.4)
fog-cloudatcost (~> 0.1.0) fog-cloudatcost (~> 0.1.0)
fog-core (~> 1.43) fog-core (~> 1.45)
fog-digitalocean (>= 0.3.0) fog-digitalocean (>= 0.3.0)
fog-dnsimple (~> 1.0) fog-dnsimple (~> 1.0)
fog-dynect (~> 0.0.2) fog-dynect (~> 0.0.2)
fog-ecloud (~> 0.1) fog-ecloud (~> 0.1)
fog-google (<= 0.1.0) fog-google (<= 0.1.0)
fog-internet-archive
fog-joyent
fog-json fog-json
fog-local fog-local
fog-openstack fog-openstack
@ -180,36 +197,37 @@ GEM
fog-xml (~> 0.1.1) fog-xml (~> 0.1.1)
ipaddress (~> 0.5) ipaddress (~> 0.5)
json (>= 1.8, < 2.0) json (>= 1.8, < 2.0)
fog-aliyun (0.1.0) fog-aliyun (0.3.8)
fog-core (~> 1.27) fog-core
fog-json (~> 1.0) fog-json
ipaddress (~> 0.8) ipaddress (~> 0.8)
xml-simple (~> 1.1) xml-simple (~> 1.1)
fog-atmos (0.1.0) fog-atmos (0.1.0)
fog-core fog-core
fog-xml fog-xml
fog-aws (1.3.0) fog-aws (2.0.1)
fog-core (~> 1.38) fog-core (~> 1.38)
fog-json (~> 1.0) fog-json (~> 1.0)
fog-xml (~> 0.1) fog-xml (~> 0.1)
ipaddress (~> 0.8) ipaddress (~> 0.8)
fog-brightbox (0.11.0) fog-brightbox (0.16.1)
fog-core (~> 1.22) dry-inflector
fog-core
fog-json fog-json
inflecto (~> 0.0.2) mime-types
fog-cloudatcost (0.1.2) fog-cloudatcost (0.1.2)
fog-core (~> 1.36) fog-core (~> 1.36)
fog-json (~> 1.0) fog-json (~> 1.0)
fog-xml (~> 0.1) fog-xml (~> 0.1)
ipaddress (~> 0.8) ipaddress (~> 0.8)
fog-core (1.43.0) fog-core (1.45.0)
builder builder
excon (~> 0.49) excon (~> 0.58)
formatador (~> 0.2) formatador (~> 0.2)
fog-digitalocean (0.3.0) fog-digitalocean (0.4.0)
fog-core (~> 1.42) fog-core
fog-json (>= 1.0) fog-json
fog-xml (>= 0.1) fog-xml
ipaddress (>= 0.5) ipaddress (>= 0.5)
fog-dnsimple (1.0.0) fog-dnsimple (1.0.0)
fog-core (~> 1.38) fog-core (~> 1.38)
@ -225,23 +243,30 @@ GEM
fog-core fog-core
fog-json fog-json
fog-xml fog-xml
fog-json (1.0.2) fog-internet-archive (0.0.1)
fog-core (~> 1.0) fog-core
fog-json
fog-xml
fog-joyent (0.0.1)
fog-core (~> 1.42)
fog-json (>= 1.0)
fog-json (1.2.0)
fog-core
multi_json (~> 1.10) multi_json (~> 1.10)
fog-local (0.3.1) fog-local (0.6.0)
fog-core (~> 1.27) fog-core (>= 1.27, < 3.0)
fog-openstack (0.1.20) fog-openstack (0.3.10)
fog-core (>= 1.40) fog-core (>= 1.45, <= 2.1.0)
fog-json (>= 1.0) fog-json (>= 1.0)
ipaddress (>= 0.8) ipaddress (>= 0.8)
fog-powerdns (0.1.1) fog-powerdns (0.2.0)
fog-core (~> 1.27) fog-core
fog-json (~> 1.0) fog-json
fog-xml (~> 0.1) fog-xml
fog-profitbricks (3.0.0) fog-profitbricks (4.1.1)
fog-core (~> 1.42) fog-core (~> 1.42)
fog-json (~> 1.0) fog-json (~> 1.0)
fog-rackspace (0.1.4) fog-rackspace (0.1.6)
fog-core (>= 1.35) fog-core (>= 1.35)
fog-json (>= 1.0) fog-json (>= 1.0)
fog-xml (>= 0.1) fog-xml (>= 0.1)
@ -275,64 +300,67 @@ GEM
fog-voxel (0.1.0) fog-voxel (0.1.0)
fog-core fog-core
fog-xml fog-xml
fog-vsphere (1.9.0) fog-vsphere (3.3.0)
fog-core fog-core
rbvmomi (~> 1.9) rbvmomi (>= 1.9, < 3)
fog-xenserver (0.3.0) fog-xenserver (1.0.0)
fog-core fog-core
fog-xml fog-xml
xmlrpc
fog-xml (0.1.3) fog-xml (0.1.3)
fog-core fog-core
nokogiri (>= 1.5.11, < 2.0.0) nokogiri (>= 1.5.11, < 2.0.0)
font-awesome-rails (4.3.0.0) font-awesome-rails (4.7.0.5)
railties (>= 3.2, < 5.0) railties (>= 3.2, < 6.1)
font-kit-rails (1.2.0) font-kit-rails (1.2.0)
rails rails
foreman (0.84.0) foreman (0.87.1)
thor (~> 0.19.1)
formatador (0.2.5) formatador (0.2.5)
globalid (0.4.2) globalid (0.4.2)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
guard (2.14.1) guard (2.16.2)
formatador (>= 0.2.4) formatador (>= 0.2.4)
listen (>= 2.7, < 4.0) listen (>= 2.7, < 4.0)
lumberjack (~> 1.0) lumberjack (>= 1.0.12, < 2.0)
nenv (~> 0.1) nenv (~> 0.1)
notiffany (~> 0.0) notiffany (~> 0.0)
pry (>= 0.9.12) pry (>= 0.9.12)
shellany (~> 0.0) shellany (~> 0.0)
thor (>= 0.18.1) thor (>= 0.18.1)
guard-brakeman (0.8.3) guard-brakeman (0.8.6)
brakeman (>= 2.1.1) brakeman (>= 2.1.1)
guard (>= 2.0.0) guard (>= 2.0.0)
haml (4.0.7) guard-compat (~> 1.0)
guard-compat (1.2.1)
haml (5.1.2)
temple (>= 0.8.0)
tilt tilt
hashie (4.1.0) hashie (4.1.0)
hike (1.2.3) http (4.4.1)
http (2.2.1)
addressable (~> 2.3) addressable (~> 2.3)
http-cookie (~> 1.0) http-cookie (~> 1.0)
http-form_data (~> 1.0.1) http-form_data (~> 2.2)
http_parser.rb (~> 0.6.0) http-parser (~> 1.2.0)
http-cookie (1.0.3) http-cookie (1.0.3)
domain_name (~> 0.5) domain_name (~> 0.5)
http-form_data (1.0.1) http-form_data (2.3.0)
http-parser (1.2.1)
ffi-compiler (>= 1.0, < 2.0)
http_parser.rb (0.6.0) http_parser.rb (0.6.0)
httparty (0.14.0) httparty (0.18.0)
mime-types (~> 3.0)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
i18n (0.9.5) i18n (0.9.5)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
i18n-js (3.0.0.rc10) i18n-js (3.0.0.rc10)
i18n (~> 0.6) i18n (~> 0.6)
inflecto (0.0.2)
ipaddress (0.8.3) ipaddress (0.8.3)
jbuilder (2.2.16) jbuilder (2.10.0)
activesupport (>= 3.0.0, < 5) activesupport (>= 5.0.0)
multi_json (~> 1.2) jquery-minicolors-rails (2.2.6.2)
jquery-minicolors-rails (2.2.3.1)
jquery-rails jquery-rails
rails (>= 3.2.8) rails (>= 3.2.8)
jquery-rails (4.3.1) jquery-rails (4.3.5)
rails-dom-testing (>= 1, < 3) rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0) railties (>= 4.2.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
@ -354,52 +382,54 @@ GEM
activerecord activerecord
kaminari-core (= 1.2.0) kaminari-core (= 1.2.0)
kaminari-core (1.2.0) kaminari-core (1.2.0)
kgio (2.11.0) kgio (2.11.3)
launchy (2.4.3) launchy (2.5.0)
addressable (~> 2.3) addressable (~> 2.7)
letter_opener (1.4.1) letter_opener (1.7.0)
launchy (~> 2.2) launchy (~> 2.2)
listen (3.1.5) listen (3.2.1)
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.10)
ruby_dep (~> 1.2)
loofah (2.5.0) loofah (2.5.0)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
lumberjack (1.0.11) lumberjack (1.2.4)
mail (2.6.4) mail (2.7.1)
mime-types (>= 1.16, < 4) mini_mime (>= 0.1.1)
memoizable (0.4.2) memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1) thread_safe (~> 0.3, >= 0.3.1)
method_source (0.8.2) method_source (1.0.0)
mime-types (3.1) mime-types (3.3.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521) mime-types-data (3.2019.1009)
mimemagic (0.3.0) mimemagic (0.3.0)
mini_mime (1.0.2)
mini_portile2 (2.4.0) mini_portile2 (2.4.0)
minitest (5.11.3) minitest (5.14.0)
momentjs-rails (2.17.1) momentjs-rails (2.20.1)
railties (>= 3.1) railties (>= 3.1)
multi_json (1.12.1) multi_json (1.14.1)
multi_xml (0.6.0) multi_xml (0.6.0)
multipart-post (2.0.0) multipart-post (2.1.1)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
naught (1.1.0) naught (1.1.0)
nenv (0.3.0) nenv (0.3.0)
nested_form (0.3.2) nested_form (0.3.2)
net-scp (1.2.1) net-scp (2.0.0)
net-ssh (>= 2.6.5) net-ssh (>= 2.6.5, < 6.0.0)
net-ssh (4.1.0) net-ssh (5.2.0)
newrelic_rpm (4.2.0.334) newrelic_rpm (6.10.0.364)
nio4r (2.5.2) nio4r (2.5.2)
nokogiri (1.10.9) nokogiri (1.10.9)
mini_portile2 (~> 2.4.0) mini_portile2 (~> 2.4.0)
nokogumbo (2.0.1) nokogumbo (2.0.2)
nokogiri (~> 1.8, >= 1.8.4) nokogiri (~> 1.8, >= 1.8.4)
notiffany (0.1.1) notiffany (0.1.3)
nenv (~> 0.1) nenv (~> 0.1)
shellany (~> 0.0) shellany (~> 0.0)
nprogress-rails (0.2.0.2) nprogress-rails (0.2.0.2)
oauth (0.5.1) oauth (0.5.4)
omniauth (1.9.1) omniauth (1.9.1)
hashie (>= 3.4.6) hashie (>= 3.4.6)
rack (>= 1.6.2, < 3) rack (>= 1.6.2, < 3)
@ -412,6 +442,7 @@ GEM
omniauth-twitter (1.4.0) omniauth-twitter (1.4.0)
omniauth-oauth (~> 1.1) omniauth-oauth (~> 1.1)
rack rack
optimist (3.0.0)
orm_adapter (0.5.0) orm_adapter (0.5.0)
paperclip (4.3.7) paperclip (4.3.7)
activemodel (>= 3.2.0) activemodel (>= 3.2.0)
@ -419,201 +450,206 @@ GEM
cocaine (~> 0.5.5) cocaine (~> 0.5.5)
mime-types mime-types
mimemagic (= 0.3.0) mimemagic (= 0.3.0)
pg (0.20.0) pg (1.2.3)
pghero (1.6.4) pghero (2.4.2)
activerecord activerecord (>= 5)
poltergeist (1.14.0) poltergeist (1.18.1)
capybara (~> 2.1) capybara (>= 2.1, < 4)
cliver (~> 0.3.1) cliver (~> 0.3.1)
websocket-driver (>= 0.2.0) websocket-driver (>= 0.2.0)
pry (0.10.4) pry (0.13.1)
coderay (~> 1.1.0) coderay (~> 1.1)
method_source (~> 0.8.1) method_source (~> 1.0)
slop (~> 3.4) public_suffix (4.0.4)
public_suffix (2.0.5)
puma (4.3.3) puma (4.3.3)
nio4r (~> 2.0) nio4r (~> 2.0)
rack (1.6.13) rack (2.0.9)
rack-pjax (1.1.0) rack-pjax (1.1.0)
nokogiri (~> 1.5) nokogiri (~> 1.5)
rack (>= 1.1) rack (>= 1.1)
rack-protection (1.5.5) rack-protection (2.0.8.1)
rack rack
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
rails (4.2.11.1) rails (5.0.7.2)
actionmailer (= 4.2.11.1) actioncable (= 5.0.7.2)
actionpack (= 4.2.11.1) actionmailer (= 5.0.7.2)
actionview (= 4.2.11.1) actionpack (= 5.0.7.2)
activejob (= 4.2.11.1) actionview (= 5.0.7.2)
activemodel (= 4.2.11.1) activejob (= 5.0.7.2)
activerecord (= 4.2.11.1) activemodel (= 5.0.7.2)
activesupport (= 4.2.11.1) activerecord (= 5.0.7.2)
bundler (>= 1.3.0, < 2.0) activesupport (= 5.0.7.2)
railties (= 4.2.11.1) bundler (>= 1.3.0)
sprockets-rails railties (= 5.0.7.2)
rails-assets-growl (1.3.2) sprockets-rails (>= 2.0.0)
rails-assets-growl (1.3.5)
rails-assets-jquery rails-assets-jquery
rails-assets-jquery (2.2.4) rails-assets-jquery (2.2.4)
rails-deprecated_sanitizer (1.0.3) rails-dom-testing (2.0.3)
activesupport (>= 4.2.0.alpha) activesupport (>= 4.2.0)
rails-dom-testing (1.0.9) nokogiri (>= 1.6)
activesupport (>= 4.2.0, < 5.0) rails-html-sanitizer (1.3.0)
nokogiri (~> 1.6) loofah (~> 2.3)
rails-deprecated_sanitizer (>= 1.0.1) rails-i18n (5.1.3)
rails-html-sanitizer (1.0.4) i18n (>= 0.7, < 2)
loofah (~> 2.2, >= 2.2.2) railties (>= 5.0, < 6)
rails-i18n (4.0.9) rails_admin (2.0.2)
i18n (~> 0.7) activemodel-serializers-xml (>= 1.0)
railties (~> 4.0)
rails_admin (1.4.3)
builder (~> 3.1) builder (~> 3.1)
coffee-rails (~> 4.0)
font-awesome-rails (>= 3.0, < 5)
haml (>= 4.0, < 6) haml (>= 4.0, < 6)
jquery-rails (>= 3.0, < 5) jquery-rails (>= 3.0, < 5)
jquery-ui-rails (>= 5.0, < 7) jquery-ui-rails (>= 5.0, < 7)
kaminari (>= 0.14, < 2.0) kaminari (>= 0.14, < 2.0)
nested_form (~> 0.3) nested_form (~> 0.3)
rack-pjax (>= 0.7) rack-pjax (>= 0.7)
rails (>= 4.0, < 6) rails (>= 5.0, < 7)
remotipart (~> 1.3) remotipart (~> 1.3)
sass-rails (>= 4.0, < 6) sassc-rails (>= 1.3, < 3)
railties (4.2.11.1) railties (5.0.7.2)
actionpack (= 4.2.11.1) actionpack (= 5.0.7.2)
activesupport (= 4.2.11.1) activesupport (= 5.0.7.2)
method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
raindrops (0.18.0) raindrops (0.19.1)
rake (13.0.1) rake (13.0.1)
rb-fsevent (0.9.8) rb-fsevent (0.10.3)
rb-inotify (0.9.8) rb-inotify (0.10.1)
ffi (>= 0.5.0) ffi (~> 1.0)
rbvmomi (1.10.0) rbvmomi (2.4.1)
builder (~> 3.0) builder (~> 3.0)
json (>= 1.8) json (>= 1.8)
nokogiri (~> 1.5) nokogiri (~> 1.5)
trollop (~> 2.1) optimist (~> 3.0)
rdoc (4.3.0) rdoc (4.3.0)
redcarpet (3.4.0) redcarpet (3.5.0)
redis (3.3.3) redis (4.1.3)
regexp_parser (1.7.0)
remotipart (1.4.4) remotipart (1.4.4)
responders (2.4.1) responders (3.0.0)
actionpack (>= 4.2.0, < 6.0) actionpack (>= 5.0)
railties (>= 4.2.0, < 6.0) railties (>= 5.0)
rollbar (2.14.1) rollbar (2.24.0)
multi_json rspec-core (3.9.1)
rspec-core (3.5.4) rspec-support (~> 3.9.1)
rspec-support (~> 3.5.0) rspec-expectations (3.9.1)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0) rspec-support (~> 3.9.0)
rspec-mocks (3.5.0) rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0) rspec-support (~> 3.9.0)
rspec-rails (3.5.2) rspec-rails (3.9.1)
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
railties (>= 3.0) railties (>= 3.0)
rspec-core (~> 3.5.0) rspec-core (~> 3.9.0)
rspec-expectations (~> 3.5.0) rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.5.0) rspec-mocks (~> 3.9.0)
rspec-support (~> 3.5.0) rspec-support (~> 3.9.0)
rspec-support (3.5.0) rspec-support (3.9.2)
ruby-progressbar (1.8.1) ruby-progressbar (1.10.1)
ruby_dep (1.5.0) ruby2_keywords (0.0.2)
sanitize (5.0.0) sanitize (5.1.0)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.8.0) nokogiri (>= 1.8.0)
nokogumbo (~> 2.0) nokogumbo (~> 2.0)
sass (3.2.19) sass (3.7.4)
sass-rails (4.0.5) sass-listen (~> 4.0.0)
railties (>= 4.0.0, < 5.0) sass-listen (4.0.0)
sass (~> 3.2.2) rb-fsevent (~> 0.9, >= 0.9.4)
sprockets (~> 2.8, < 3.0) rb-inotify (~> 0.9, >= 0.9.7)
sprockets-rails (~> 2.0) sass-rails (5.0.7)
sassc (2.0.1) railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sassc (2.3.0)
ffi (~> 1.9) ffi (~> 1.9)
rake sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
sdoc (0.4.2) sdoc (0.4.2)
json (~> 1.7, >= 1.7.7) json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0) rdoc (~> 4.0)
shellany (0.0.1) shellany (0.0.1)
sidekiq (4.2.10) sidekiq (5.2.8)
concurrent-ruby (~> 1.0) connection_pool (~> 2.2, >= 2.2.2)
connection_pool (~> 2.2, >= 2.2.0) rack (< 2.1.0)
rack-protection (>= 1.5.0) rack-protection (>= 1.5.0)
redis (~> 3.2, >= 3.2.1) redis (>= 3.3.5, < 5)
simple_oauth (0.3.1) simple_oauth (0.3.1)
simplecov (0.14.1) simplecov (0.18.5)
docile (~> 1.1.0) docile (~> 1.1)
json (>= 1.8, < 3) simplecov-html (~> 0.11)
simplecov-html (~> 0.10.0) simplecov-html (0.12.2)
simplecov-html (0.10.0) simplecov-json (0.2.1)
simplecov-json (0.2)
json json
simplecov simplecov
simplecov-rcov (0.2.3) simplecov-rcov (0.2.3)
simplecov (>= 0.4.1) simplecov (>= 0.4.1)
sinatra (1.4.8) sinatra (2.0.8.1)
rack (~> 1.5) mustermann (~> 1.0)
rack-protection (~> 1.4) rack (~> 2.0)
tilt (>= 1.3, < 3) rack-protection (= 2.0.8.1)
slop (3.6.0) tilt (~> 2.0)
spring (1.3.6) spring (1.3.6)
sprockets (2.12.5) sprockets (3.7.2)
hike (~> 1.2) concurrent-ruby (~> 1.0)
multi_json (~> 1.0) rack (> 1, < 3)
rack (~> 1.0) sprockets-rails (3.2.1)
tilt (~> 1.1, != 1.3.0) actionpack (>= 4.0)
sprockets-rails (2.3.3) activesupport (>= 4.0)
actionpack (>= 3.0) sprockets (>= 3.0.0)
activesupport (>= 3.0) sshkit (1.21.0)
sprockets (>= 2.8, < 4.0)
sshkit (1.13.1)
net-scp (>= 1.1.2) net-scp (>= 1.1.2)
net-ssh (>= 2.8.0) net-ssh (>= 2.8.0)
sweetalert-rails (1.1.3) sweetalert-rails (1.1.3)
railties (>= 3.1.0) railties (>= 3.1.0)
thor (0.19.4) temple (0.8.2)
thor (1.0.1)
thread_safe (0.3.6) thread_safe (0.3.6)
tilt (1.4.1) tilt (2.0.10)
tiny-color-rails (0.0.2) tiny-color-rails (0.0.2)
railties (>= 3.0) railties (>= 3.0)
trollop (2.1.2) tumblr_client (0.8.5)
tumblr_client (0.8.2) faraday (~> 0.9.0)
faraday (>= 0.8) faraday_middleware (~> 0.9.0)
faraday_middleware (>= 0.8)
json json
mime-types mime-types
oauth oauth
simple_oauth simple_oauth
turbolinks (2.5.3) turbolinks (2.5.4)
coffee-rails coffee-rails
twemoji-rails (1.2.1.3) twemoji-rails (1.2.1.3)
railties (>= 3.0.0) railties (>= 3.0.0)
twitter (6.1.0) twitter (7.0.0)
addressable (~> 2.5) addressable (~> 2.3)
buftok (~> 0.2.0) buftok (~> 0.2.0)
equalizer (= 0.0.11) equalizer (~> 0.0.11)
faraday (~> 0.11.0) http (~> 4.0)
http (~> 2.1) http-form_data (~> 2.0)
http_parser.rb (~> 0.6.0) http_parser.rb (~> 0.6.0)
memoizable (~> 0.4.2) memoizable (~> 0.4.0)
naught (~> 1.1) multipart-post (~> 2.0)
simple_oauth (~> 0.3.1) naught (~> 1.0)
tzinfo (1.2.5) simple_oauth (~> 0.3.0)
tzinfo (1.2.7)
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (3.1.12) uglifier (4.2.0)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
unf (0.1.4) unf (0.1.4)
unf_ext unf_ext
unf_ext (0.0.7.2) unf_ext (0.0.7.7)
unicorn (5.2.0) unicorn (5.5.4)
kgio (~> 2.6) kgio (~> 2.6)
raindrops (~> 0.7) raindrops (~> 0.7)
warden (1.2.7) warden (1.2.8)
rack (>= 1.0) rack (>= 2.0.6)
web-console (2.3.0) web-console (2.3.0)
activemodel (>= 4.0) activemodel (>= 4.0)
binding_of_caller (>= 0.7.2) binding_of_caller (>= 0.7.2)
@ -621,13 +657,14 @@ GEM
sprockets-rails (>= 2.0, < 4.0) sprockets-rails (>= 2.0, < 4.0)
websocket-driver (0.6.5) websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2) websocket-extensions (0.1.4)
will_paginate (3.1.5) will_paginate (3.3.0)
will_paginate-bootstrap (1.0.1) will_paginate-bootstrap (1.0.2)
will_paginate (>= 3.0.3) will_paginate (>= 3.0.3)
xml-simple (1.1.5) xml-simple (1.1.5)
xpath (2.0.0) xmlrpc (0.3.0)
nokogiri (~> 1.3) xpath (3.2.0)
nokogiri (~> 1.8)
PLATFORMS PLATFORMS
ruby ruby
@ -644,7 +681,7 @@ DEPENDENCIES
capistrano (~> 3.8) capistrano (~> 3.8)
capistrano-rails capistrano-rails
capybara capybara
coffee-rails (~> 4.1.0) coffee-rails (~> 4.1)
colorize colorize
database_cleaner database_cleaner
delayed_paperclip delayed_paperclip
@ -656,14 +693,14 @@ DEPENDENCIES
faker faker
fog fog
fog-aws fog-aws
font-awesome-rails (~> 4.3.0.0) font-awesome-rails (~> 4.7.0)
font-kit-rails font-kit-rails
foreman foreman
guard-brakeman guard-brakeman
haml (~> 4.0) haml (~> 5.0)
httparty httparty
i18n-js (= 3.0.0.rc10) i18n-js (= 3.0.0.rc10)
jbuilder (~> 2.2.4) jbuilder (~> 2.10)
jquery-minicolors-rails jquery-minicolors-rails
jquery-rails jquery-rails
jquery-turbolinks jquery-turbolinks
@ -680,21 +717,21 @@ DEPENDENCIES
poltergeist poltergeist
puma puma
questiongenerator! questiongenerator!
rails (~> 4.2.11, >= 4.2.11.1) rails (~> 5.0.7, >= 5.0.7.2)
rails-assets-growl rails-assets-growl
rails-assets-jquery (~> 2.2.0) rails-assets-jquery (~> 2.2.0)
rails-i18n rails-i18n (~> 5.0)
rails_admin rails_admin
rake rake
redcarpet redcarpet
redis redis
rollbar rollbar
rspec-rails (~> 3.5) rspec-rails (~> 3.9)
ruby-progressbar ruby-progressbar
sanitize sanitize
sass-rails (~> 4.0.3) sass-rails (~> 5.0)
sdoc (~> 0.4.1) sdoc (~> 0.4.1)
sidekiq sidekiq (< 6)
simplecov simplecov
simplecov-json simplecov-json
simplecov-rcov simplecov-rcov

View File

@ -2,7 +2,7 @@ module ThemeHelper
def render_theme_with_context(context = {}) def render_theme_with_context(context = {})
klass = Class.new do klass = Class.new do
def initialize(hash = {}) def initialize(hash = {})
if hash.is_a? ActiveRecord::Base if hash.is_a? ApplicationRecord
x = [ x = [
:primary_color, :primary_text, :primary_color, :primary_text,
:danger_color, :danger_text, :danger_color, :danger_text,

View File

@ -1,4 +1,4 @@
class Answer < ActiveRecord::Base class Answer < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :question belongs_to :question
has_many :comments, dependent: :destroy has_many :comments, dependent: :destroy

View File

@ -0,0 +1,5 @@
# frozen_string_literal: true
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end

View File

@ -1,4 +1,4 @@
class Comment < ActiveRecord::Base class Comment < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :answer belongs_to :answer
validates :user_id, presence: true validates :user_id, presence: true

View File

@ -1,4 +1,4 @@
class CommentSmile < ActiveRecord::Base class CommentSmile < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :comment belongs_to :comment
validates :user_id, presence: true, uniqueness: { scope: :comment_id, message: "already smiled comment" } validates :user_id, presence: true, uniqueness: { scope: :comment_id, message: "already smiled comment" }

View File

@ -1,4 +1,4 @@
class Group < ActiveRecord::Base class Group < ApplicationRecord
belongs_to :user belongs_to :user
has_many :group_members, dependent: :destroy has_many :group_members, dependent: :destroy

View File

@ -1,4 +1,4 @@
class GroupMember < ActiveRecord::Base class GroupMember < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :group belongs_to :group
end end

View File

@ -1,4 +1,4 @@
class Inbox < ActiveRecord::Base class Inbox < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :question belongs_to :question

View File

@ -1,4 +1,4 @@
class ModerationComment < ActiveRecord::Base class ModerationComment < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :report belongs_to :report
validates :user_id, presence: true validates :user_id, presence: true

View File

@ -1,4 +1,4 @@
class ModerationVote < ActiveRecord::Base class ModerationVote < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :report belongs_to :report
validates :user_id, presence: true validates :user_id, presence: true

View File

@ -1,4 +1,4 @@
class Notification < ActiveRecord::Base class Notification < ApplicationRecord
belongs_to :recipient, class_name: 'User' belongs_to :recipient, class_name: 'User'
belongs_to :target, polymorphic: true belongs_to :target, polymorphic: true

View File

@ -1,4 +1,4 @@
class Question < ActiveRecord::Base class Question < ApplicationRecord
belongs_to :user belongs_to :user
has_many :answers, dependent: :destroy has_many :answers, dependent: :destroy
has_many :inboxes, dependent: :destroy has_many :inboxes, dependent: :destroy

View File

@ -1,4 +1,4 @@
class Relationship < ActiveRecord::Base class Relationship < ApplicationRecord
belongs_to :source, class_name: 'User' belongs_to :source, class_name: 'User'
belongs_to :target, class_name: 'User' belongs_to :target, class_name: 'User'
validates :source_id, presence: true validates :source_id, presence: true

View File

@ -1,4 +1,4 @@
class Report < ActiveRecord::Base class Report < ApplicationRecord
belongs_to :user belongs_to :user
has_many :moderation_votes, dependent: :destroy has_many :moderation_votes, dependent: :destroy
has_many :moderation_comments, dependent: :destroy has_many :moderation_comments, dependent: :destroy

View File

@ -1,4 +1,4 @@
class Service < ActiveRecord::Base class Service < ApplicationRecord
attr_accessor :provider, :info attr_accessor :provider, :info
belongs_to :user belongs_to :user

View File

@ -1,4 +1,4 @@
class Smile < ActiveRecord::Base class Smile < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :answer belongs_to :answer
validates :user_id, presence: true, uniqueness: { scope: :answer_id, message: "already smiled answer" } validates :user_id, presence: true, uniqueness: { scope: :answer_id, message: "already smiled answer" }

View File

@ -1,4 +1,4 @@
class Subscription < ActiveRecord::Base class Subscription < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :answer belongs_to :answer

View File

@ -1,4 +1,4 @@
class Theme < ActiveRecord::Base class Theme < ApplicationRecord
include ThemeHelper include ThemeHelper
belongs_to :user belongs_to :user

View File

@ -1,4 +1,4 @@
class User < ActiveRecord::Base class User < ApplicationRecord
# Include default devise modules. Others available are: # Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable # :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :async, :registerable, devise :database_authenticatable, :async, :registerable,

View File

@ -22,4 +22,4 @@
= render 'inbox/sidebar' = render 'inbox/sidebar'
= render "shared/links" = render "shared/links"
- @inbox.update_all(new: false) - Inbox.where(id: @inbox.ids).update_all(new: false)

View File

@ -1,4 +1,4 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__) APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot' require_relative '../config/boot'
require 'rails/commands' require 'rails/commands'

View File

@ -1,29 +1,34 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require 'pathname' require 'pathname'
require 'fileutils'
include FileUtils
# path to your application root. # path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
Dir.chdir APP_ROOT do def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
chdir APP_ROOT do
# This script is a starting point to setup your application. # This script is a starting point to setup your application.
# Add necessary setup steps to this file: # Add necessary setup steps to this file.
puts "== Installing dependencies ==" puts '== Installing dependencies =='
system "gem install bundler --conservative" system! 'gem install bundler --conservative'
system "bundle check || bundle install" system('bundle check') || system!('bundle install')
# puts "\n== Copying sample files ==" # puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml") # unless File.exist?('config/database.yml')
# system "cp config/database.yml.sample config/database.yml" # cp 'config/database.yml.sample', 'config/database.yml'
# end # end
puts "\n== Preparing database ==" puts "\n== Preparing database =="
system "bin/rake db:setup" system! 'bin/rails db:setup'
puts "\n== Removing old logs and tempfiles ==" puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*" system! 'bin/rails log:clear tmp:clear'
system "rm -rf tmp/cache"
puts "\n== Restarting application server ==" puts "\n== Restarting application server =="
system "touch tmp/restart.txt" system! 'bin/rails restart'
end end

29
bin/update Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
chdir APP_ROOT do
# This script is a way to update your development environment automatically.
# Add necessary update steps to this file.
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
puts "\n== Updating database =="
system! 'bin/rails db:migrate'
puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
puts "\n== Restarting application server =="
system! 'bin/rails restart'
end

View File

@ -1,4 +1,4 @@
require File.expand_path('../boot', __FILE__) require_relative 'boot'
require 'rails/all' require 'rails/all'
@ -14,13 +14,6 @@ module Justask
# Application configuration should go into files in config/initializers # Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded. # -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
config.autoload_paths += %W["#{config.root}/app/validators"] config.autoload_paths += %W["#{config.root}/app/validators"]
# Use Sidekiq for background jobs # Use Sidekiq for background jobs
@ -30,14 +23,6 @@ module Justask
config.i18n.fallbacks = true config.i18n.fallbacks = true
config.i18n.enforce_available_locales = false config.i18n.enforce_available_locales = false
# DEPRECATION WARNING: Currently, Active Record suppresses errors raised
# within `after_rollback`/`after_commit` callbacks and only print them to the logs.
# In the next version, these errors will no longer be suppressed.
# Instead, the errors will propagate normally just like in other Active Record callbacks.
# fix for this warning:
config.active_record.raise_in_transactional_callbacks = true
config.after_initialize do config.after_initialize do
Dir.glob Rails.root.join('config/late_initializers/*.rb') do |f| Dir.glob Rails.root.join('config/late_initializers/*.rb') do |f|
require f require f

View File

@ -1,4 +1,3 @@
# Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) require 'bundler/setup' # Set up gems listed in the Gemfile.

9
config/cable.yml Normal file
View File

@ -0,0 +1,9 @@
development:
adapter: async
test:
adapter: async
production:
adapter: redis
url: redis://localhost:6379/1

View File

@ -1,5 +1,5 @@
# Load the Rails application. # Load the Rails application.
require File.expand_path('../application', __FILE__) require_relative 'application'
# Initialize the Rails application. # Initialize the Rails application.
start = Time.now start = Time.now

View File

@ -9,9 +9,22 @@ Rails.application.configure do
# Do not eager load code on boot. # Do not eager load code on boot.
config.eager_load = false config.eager_load = false
# Show full error reports and disable caching. # Show full error reports.
config.consider_all_requests_local = true config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Enable/disable caching. By default caching is disabled.
if Rails.root.join('tmp/caching-dev.txt').exist?
config.action_controller.perform_caching = true
config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => 'public, max-age=172800'
}
else
config.action_controller.perform_caching = false
config.cache_store = :null_store
end
# Action Mailer Setup # Action Mailer Setup
# if you want to test sending mails locally, uncomment the line below and comment the :sendmail line # if you want to test sending mails locally, uncomment the line below and comment the :sendmail line
@ -25,10 +38,11 @@ Rails.application.configure do
config.action_mailer.delivery_method = :sendmail config.action_mailer.delivery_method = :sendmail
end end
config.action_mailer.perform_deliveries = true
# Don't care if the mailer can't send. # Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_caching = false
# Print deprecation notices to the Rails logger. # Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log config.active_support.deprecation = :log
@ -40,11 +54,13 @@ Rails.application.configure do
# number of complex assets. # number of complex assets.
config.assets.debug = true config.assets.debug = true
# Adds additional error checking when serving assets at runtime. # Suppress logger output for asset requests.
# Checks for improperly declared sprockets dependencies. config.assets.quiet = true
# Raises helpful error messages.
config.assets.raise_runtime_errors = true
# Raises error for missing translations # Raises error for missing translations
# config.action_view.raise_on_missing_translations = true # config.action_view.raise_on_missing_translations = true
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
end end

View File

@ -14,13 +14,9 @@ Rails.application.configure do
config.consider_all_requests_local = false config.consider_all_requests_local = false
config.action_controller.perform_caching = true config.action_controller.perform_caching = true
# Enable Rack::Cache to put a simple HTTP cache in front of your application # Disable serving static files from the `/public` folder by default since
# Add `rack-cache` to your Gemfile before enabling this. # Apache or NGINX already handles this.
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
# config.action_dispatch.rack_cache = true
# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_files = false
# Compress JavaScripts and CSS. # Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier config.assets.js_compressor = :uglifier
@ -29,36 +25,41 @@ Rails.application.configure do
# Do not fallback to assets pipeline if a precompiled asset is missed. # Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false config.assets.compile = false
# Generate digests for assets URLs. # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
config.assets.digest = true
# `config.assets.precompile` has moved to config/initializers/assets.rb # Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
# Specifies the header that your server uses for sending files. # Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Mount Action Cable outside main process or domain
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true # config.force_ssl = true
# Set to :debug to see everything in the log. # Use the lowest log level to ensure availability of diagnostic information
config.log_level = :info # when problems arise.
config.log_level = :debug
# Prepend all log lines with the following tags. # Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ] config.log_tags = [ :request_id ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production. # Use a different cache store in production.
# config.cache_store = :mem_cache_store # config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server. # Use a real queuing backend for Active Job (and separate queues per environment)
# config.action_controller.asset_host = "http://assets.example.com" # config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "justask_#{Rails.env}"
config.action_mailer.perform_caching = false
# Precompile additional assets. # Ignore bad email addresses and do not raise email delivery errors.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.assets.precompile += %w( search.js ) # config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found). # the I18n.default_locale when a translation cannot be found).
@ -67,19 +68,19 @@ Rails.application.configure do
# Send deprecation notices to registered listeners. # Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify config.active_support.deprecation = :notify
config.action_mailer.delivery_method = :sendmail
# config.action_mailer.default_url_options = { host: 'retrospring.net' }
config.action_mailer.perform_deliveries = true
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
config.action_mailer.raise_delivery_errors = true
# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false
# Use default logging formatter so that PID and timestamp are not suppressed. # Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new config.log_formatter = ::Logger::Formatter.new
# Use a different logger for distributed setups.
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end
# Do not dump schema after migrations. # Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false config.active_record.dump_schema_after_migration = false
end end

View File

@ -12,9 +12,11 @@ Rails.application.configure do
# preloads Rails for running tests, you may have to set it to true. # preloads Rails for running tests, you may have to set it to true.
config.eager_load = false config.eager_load = false
# Configure static asset server for tests with Cache-Control for performance. # Configure public file server for tests with Cache-Control for performance.
config.serve_static_files = true config.public_file_server.enabled = true
config.static_cache_control = 'public, max-age=3600' config.public_file_server.headers = {
'Cache-Control' => 'public, max-age=3600'
}
# Show full error reports and disable caching. # Show full error reports and disable caching.
config.consider_all_requests_local = true config.consider_all_requests_local = true
@ -25,6 +27,7 @@ Rails.application.configure do
# Disable request forgery protection in test environment. # Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false config.action_controller.allow_forgery_protection = false
config.action_mailer.perform_caching = false
# Tell Action Mailer not to deliver emails to the real world. # Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the # The :test delivery method accumulates sent emails in the

View File

@ -0,0 +1,8 @@
# Be sure to restart your server when you modify this file.
# ActiveSupport::Reloader.to_prepare do
# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
# end

View File

@ -3,6 +3,9 @@
# Version of your assets, change this if you want to expire all your assets. # Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0' Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional assets. # Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
Rails.application.config.assets.precompile += %w( moderation.js ) Rails.application.config.assets.precompile += %w( moderation.js )

View File

@ -1,3 +1,5 @@
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
Rails.application.config.action_dispatch.cookies_serializer = :json # Specify a serializer for the signed and encrypted cookie jars.
# Valid options are :json, :marshal, and :hybrid.
Rails.application.config.action_dispatch.cookies_serializer = :json

View File

@ -1 +0,0 @@
Haml::Template.options[:ugly] = true

View File

@ -0,0 +1,25 @@
# Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 5.0 upgrade.
#
# Once upgraded flip defaults one by one to migrate to the new default.
#
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
Rails.application.config.action_controller.raise_on_unfiltered_parameters = true
# Enable per-form CSRF tokens. Previous versions had false.
Rails.application.config.action_controller.per_form_csrf_tokens = false
# Enable origin-checking CSRF mitigation. Previous versions had false.
Rails.application.config.action_controller.forgery_protection_origin_check = false
# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
# Previous versions had false.
ActiveSupport.to_time_preserves_timezone = false
# Require `belongs_to` associations by default. Previous versions had false.
Rails.application.config.active_record.belongs_to_required_by_default = true# false
# Do not halt callback chains when a callback returns false. Previous versions had true.
ActiveSupport.halt_callback_chains_on_return_false = true

View File

@ -5,10 +5,10 @@
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do ActiveSupport.on_load(:action_controller) do
wrap_parameters format: [:json] if respond_to?(:wrap_parameters) wrap_parameters format: [:json]
end end
# To enable root element in JSON for ActiveRecord objects. # To enable root element in JSON for ActiveRecord objects.
# ActiveSupport.on_load(:active_record) do # ActiveSupport.on_load(:active_record) do
# self.include_root_in_json = true # self.include_root_in_json = true
# end # end

47
config/puma.rb Normal file
View File

@ -0,0 +1,47 @@
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum, this matches the default thread size of Active Record.
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
threads threads_count, threads_count
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
#
port ENV.fetch("PORT") { 3000 }
# Specifies the `environment` that Puma will run in.
#
environment ENV.fetch("RAILS_ENV") { "development" }
# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked webserver processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory. If you use this option
# you need to make sure to reconnect any threads in the `on_worker_boot`
# block.
#
# preload_app!
# The code in the `on_worker_boot` will be called if you are using
# clustered mode by specifying a number of `workers`. After each worker
# process is booted this block will be run, if you are using `preload_app!`
# option you will want to use this block to reconnect to any threads
# or connections that may have been created at application boot, Ruby
# cannot share connections between processes.
#
# on_worker_boot do
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
# end
# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart

View File

@ -5,7 +5,7 @@
# Make sure the secret is at least 30 characters and all random, # Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks. # no regular words or you'll be exposed to dictionary attacks.
# You can use `rake secret` to generate a secure secret key. # You can use `rails secret` to generate a secure secret key.
# Make sure the secrets in this file are kept private # Make sure the secrets in this file are kept private
# if you're sharing your code publicly. # if you're sharing your code publicly.

6
config/spring.rb Normal file
View File

@ -0,0 +1,6 @@
%w(
.ruby-version
.rbenv-vars
tmp/restart.txt
tmp/caching-dev.txt
).each { |path| Spring.watch(path) }