Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f0a462e
Merge remote-tracking branch 'origin/master' into auto-bundle-update
kaznum Nov 24, 2019
779a810
Merge remote-tracking branch 'origin/master' into auto-bundle-update
kaznum Nov 25, 2019
8c852d6
Exec bundle update
kaznum Nov 26, 2019
8a5a416
Merge remote-tracking branch 'origin/master' into bundle-update-20191127
kaznum Nov 26, 2019
94db4c7
Update rails
kaznum Nov 28, 2019
f817215
Use prepend because alias_method_chain is obsolete
kaznum Nov 28, 2019
fa01fdf
Exec rails app:update
kaznum Nov 28, 2019
38e8e40
Throw abort for error on destroy
kaznum Nov 28, 2019
bc4dd5a
Fix delete_all changes of args
kaznum Nov 28, 2019
5f801dc
Make use of prepend instead of alias_method_chain
kaznum Nov 28, 2019
7864f19
Change be_success to be_successful in rspec
kaznum Nov 28, 2019
b37fbf7
Change the option of `render` from `text` to `plain`
kaznum Nov 28, 2019
e5784fe
Define get/post methods for backward compatibility
kaznum Nov 28, 2019
6b9cc6b
Remove capistrano gem and its associates because of installation failure
kaznum Nov 28, 2019
5620ebc
Ignore ./bin directory by rubocop
kaznum Nov 28, 2019
85ae451
Remove debug print
kaznum Nov 28, 2019
2621d10
Shut rubocop up
kaznum Nov 28, 2019
a3f7757
Update Gemfile for JRuby to support Rails5.2
kaznum Nov 28, 2019
93f1a5a
Refactor
kaznum Nov 28, 2019
550bc21
Replace `render nothing: true` with `head`
kaznum Nov 28, 2019
50afce7
Support put/patch/delete for spec helper wrapper
kaznum Nov 28, 2019
94ab4ee
Exec bundle update rails
kaznum Nov 29, 2019
7f86ab6
Replace `render text: xxxx` with `render plain: xxxx`
kaznum Nov 29, 2019
7b0a6d8
Follow the change of the nil-valued key in params
kaznum Nov 29, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ AllCops:
- features/**/*
- db/migrate/**/*
- lib/arel_node_match_postgres_ext.rb
- bin/**/*
TargetRubyVersion: 2.3

Layout/MultilineOperationIndentation:
Expand Down
9 changes: 4 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source 'http://rubygems.org'
### Please see gemfiles/Gemfile.jruby for JRuby env
###

gem 'rails', '~> 4.2.11'
gem 'rails', '~> 5.2.1'

# Use unicorn as the web server
# gem 'unicorn'
Expand Down Expand Up @@ -35,6 +35,7 @@ group :test do
gem 'capybara-webkit', '>= 1.0.0'
gem 'cucumber-rails', require: false
gem 'growl'
gem 'rails-controller-testing'
gem 'rb-fsevent'
gem 'simplecov'
gem 'spork'
Expand All @@ -56,16 +57,14 @@ group :production do
gem 'redis-store', '>= 1.4.0'
end

gem 'capistrano', '~> 2.0'
gem 'rvm-capistrano'

gem 'mysql2'
# for AR-4.2
gem 'pg', '~> 0.21'
# for AR-4.2
gem 'sqlite3', '~> 1.3.11'

gem 'coffee-rails', '~> 4.1.0'
gem 'bootsnap', require: false
gem 'coffee-rails'
gem 'haml', '>= 5.0.0'
gem 'haml-rails'
gem 'i18n'
Expand Down
163 changes: 84 additions & 79 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,53 +1,56 @@
GEM
remote: http://rubygems.org/
specs:
actionmailer (4.2.11.1)
actionpack (= 4.2.11.1)
actionview (= 4.2.11.1)
activejob (= 4.2.11.1)
actioncable (5.2.4)
actionpack (= 5.2.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.4)
actionpack (= 5.2.4)
actionview (= 5.2.4)
activejob (= 5.2.4)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.11.1)
actionview (= 4.2.11.1)
activesupport (= 4.2.11.1)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-dom-testing (~> 2.0)
actionpack (5.2.4)
actionview (= 5.2.4)
activesupport (= 5.2.4)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.11.1)
activesupport (= 4.2.11.1)
actionview (5.2.4)
activesupport (= 5.2.4)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (4.2.11.1)
activesupport (= 4.2.11.1)
globalid (>= 0.3.0)
activemodel (4.2.11.1)
activesupport (= 4.2.11.1)
builder (~> 3.1)
activerecord (4.2.11.1)
activemodel (= 4.2.11.1)
activesupport (= 4.2.11.1)
arel (~> 6.0)
activesupport (4.2.11.1)
i18n (~> 0.7)
activejob (5.2.4)
activesupport (= 5.2.4)
globalid (>= 0.3.6)
activemodel (5.2.4)
activesupport (= 5.2.4)
activerecord (5.2.4)
activemodel (= 5.2.4)
activesupport (= 5.2.4)
arel (>= 9.0)
activestorage (5.2.4)
actionpack (= 5.2.4)
activerecord (= 5.2.4)
marcel (~> 0.3.1)
activesupport (5.2.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
arel (6.0.4)
arel (9.0.0)
ast (2.4.0)
backports (3.15.0)
bootsnap (1.4.5)
msgpack (~> 1.0)
builder (3.2.3)
byebug (11.0.1)
capistrano (2.15.9)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
capybara (3.29.0)
addressable
mini_mime (>= 0.1.3)
Expand All @@ -61,9 +64,9 @@ GEM
json
childprocess (3.0.0)
coderay (1.1.2)
coffee-rails (4.1.1)
coffee-rails (5.0.0)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x)
railties (>= 5.2.0)
coffee-script (2.4.1)
coffee-script-source
execjs
Expand Down Expand Up @@ -102,10 +105,11 @@ GEM
dotenv-rails (2.7.5)
dotenv (= 2.7.5)
railties (>= 3.2, < 6.1)
erubi (1.9.0)
erubis (2.7.0)
execjs (2.7.0)
fabrication (2.20.2)
ffi (1.11.2)
fabrication (2.21.0)
ffi (1.11.3)
formatador (0.2.5)
gherkin (5.1.0)
globalid (0.4.2)
Expand Down Expand Up @@ -148,13 +152,12 @@ GEM
rainbow
rubocop (>= 0.50.0)
sysexits (~> 1.1)
highline (2.0.3)
html2haml (2.2.0)
erubis (~> 2.7.0)
haml (>= 4.0, < 6)
nokogiri (>= 1.6.0)
ruby_parser (~> 3.5)
i18n (0.9.5)
i18n (1.7.0)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.4)
jbuilder (2.9.1)
Expand All @@ -172,31 +175,28 @@ GEM
listen (3.2.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.3.1)
loofah (2.4.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
lumberjack (1.0.13)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
memoist (0.16.1)
method_source (0.9.2)
mime-types (3.3)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.1009)
mimemagic (0.3.3)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.13.0)
msgpack (1.3.1)
multi_json (1.14.1)
multi_test (0.1.2)
mysql2 (0.5.2)
nenv (0.3.0)
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
net-sftp (2.1.2)
net-ssh (>= 2.6.5)
net-ssh (5.2.0)
net-ssh-gateway (2.0.0)
net-ssh (>= 4.0.0)
nio4r (2.5.2)
nokogiri (1.10.5)
mini_portile2 (~> 2.4.0)
Expand All @@ -213,37 +213,41 @@ GEM
public_suffix (4.0.1)
puma (4.3.0)
nio4r (~> 2.0)
rack (1.6.11)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.11.1)
actionmailer (= 4.2.11.1)
actionpack (= 4.2.11.1)
actionview (= 4.2.11.1)
activejob (= 4.2.11.1)
activemodel (= 4.2.11.1)
activerecord (= 4.2.11.1)
activesupport (= 4.2.11.1)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.11.1)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.9)
activesupport (>= 4.2.0, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rack (2.0.7)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.4)
actioncable (= 5.2.4)
actionmailer (= 5.2.4)
actionpack (= 5.2.4)
actionview (= 5.2.4)
activejob (= 5.2.4)
activemodel (= 5.2.4)
activerecord (= 5.2.4)
activestorage (= 5.2.4)
activesupport (= 5.2.4)
bundler (>= 1.3.0)
railties (= 5.2.4)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.4)
actionpack (>= 5.0.1.x)
actionview (>= 5.0.1.x)
activesupport (>= 5.0.1.x)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
rails-observers (0.1.5)
activemodel (>= 4.0)
rails_emoji (1.7.1)
rails (>= 3.1.0)
railties (4.2.11.1)
actionpack (= 4.2.11.1)
activesupport (= 4.2.11.1)
railties (5.2.4)
actionpack (= 5.2.4)
activesupport (= 5.2.4)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
rake (13.0.1)
rb-fsevent (0.10.3)
Expand Down Expand Up @@ -308,8 +312,6 @@ GEM
ruby-progressbar (1.10.1)
ruby_parser (3.14.1)
sexp_processor (~> 4.9)
rvm-capistrano (1.5.6)
capistrano (~> 2.15.4)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
Expand Down Expand Up @@ -361,18 +363,21 @@ GEM
nokogiri (>= 1.2.0)
rack (>= 1.0)
rack-test (>= 0.5.3)
websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
xpath (3.2.0)
nokogiri (~> 1.8)

PLATFORMS
ruby

DEPENDENCIES
bootsnap
byebug
capistrano (~> 2.0)
capybara (>= 2.2.0)
capybara-webkit (>= 1.0.0)
coffee-rails (~> 4.1.0)
coffee-rails
connection_pool
cucumber-rails
database_cleaner (>= 1.2.0)
Expand All @@ -397,7 +402,8 @@ DEPENDENCIES
mysql2
pg (~> 0.21)
puma
rails (~> 4.2.11)
rails (~> 5.2.1)
rails-controller-testing
rails-observers
rails_emoji
rb-fsevent
Expand All @@ -408,7 +414,6 @@ DEPENDENCIES
rspec-collection_matchers
rspec-rails (>= 2.13.1)
rubocop
rvm-capistrano
sass-rails (~> 5.0)
settingslogic
simplecov
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def index
def authenticate
admin_user, admin_password = correct_credential
if admin_user.nil? || admin_password.nil?
render nothing: true, status: :unauthorized
head :unauthorized
return
end

Expand Down
7 changes: 3 additions & 4 deletions app/controllers/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def authenticate_via_api
@user = user
true
else
render text: 'You do not have the permission to access this resource.', status: :unauthorized
render plain: 'You do not have the permission to access this resource.', status: :unauthorized
false
end
end
Expand All @@ -41,15 +41,14 @@ def authenticate_via_api
module General
def self.included(base)
base.class_eval do
include Api::General::InstanceMethods
alias_method_chain :verified_request?, :condition
prepend Api::General::InstanceMethods
end
end

module InstanceMethods
# override the method which checks CSRF token.
def verified_request_with_condition?
doorkeeper_token || request.authorization.present? || verified_request_without_condition?
doorkeeper_token || request.authorization.present? || super
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/api/entries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def index
super
render locals: { items: @items }
rescue ArgumentError
render nothing: true, status: :not_acceptable
head :not_acceptable
end

def show
Expand Down Expand Up @@ -51,7 +51,7 @@ def _json_action(&block)
errors = [t('error.date_is_invalid')]
render json: { errors: errors }.to_json, status: :not_acceptable
rescue ActiveRecord::RecordNotFound
render nothing: true, status: :not_found
head :not_found
rescue ActiveRecord::RecordInvalid => e
errors = e.record.errors.full_messages
render json: { errors: errors }.to_json, status: :not_acceptable
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ def destroy
private

def render_when_not_login
render nothing: true, status: :unauthorized
head :unauthorized
end
end
Loading