From c19f24ed936e3e8b640a8118a4bd6478d8aefcb4 Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 15:35:27 +0900 Subject: [PATCH 01/18] bundle update --- Gemfile | 2 +- Gemfile.lock | 256 +++++++++++++++++++++++++++------------------------ 2 files changed, 138 insertions(+), 120 deletions(-) diff --git a/Gemfile b/Gemfile index 0e7b07d..133c3e3 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -gem "rails", "3.2.13" +gem "rails", "3.2.22.5" gem "jquery-rails" gem "haml-rails" diff --git a/Gemfile.lock b/Gemfile.lock index 0bdbcdd..a239e46 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,12 +1,12 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.13) - actionpack (= 3.2.13) - mail (~> 2.5.3) - actionpack (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) + actionmailer (3.2.22.5) + actionpack (= 3.2.22.5) + mail (~> 2.5.4) + actionpack (3.2.22.5) + activemodel (= 3.2.22.5) + activesupport (= 3.2.22.5) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) @@ -14,171 +14,186 @@ GEM rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) - active_decorator (0.3.4) - activemodel (3.2.13) - activesupport (= 3.2.13) + active_decorator (1.0.0) + activemodel (3.2.22.5) + activesupport (= 3.2.22.5) builder (~> 3.0.0) - activerecord (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) + activerecord (3.2.22.5) + activemodel (= 3.2.22.5) + activesupport (= 3.2.22.5) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - activesupport (3.2.13) - i18n (= 0.6.1) + activeresource (3.2.22.5) + activemodel (= 3.2.22.5) + activesupport (= 3.2.22.5) + activesupport (3.2.22.5) + i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) - arel (3.0.2) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + arel (3.0.3) + buftok (0.2.0) builder (3.0.4) - coderay (1.0.9) + coderay (1.1.2) coffee-rails (3.2.2) coffee-script (>= 2.2.0) railties (~> 3.2.0) - coffee-script (2.2.0) + coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.6.2) - commonjs (0.2.6) - domain_name (0.5.9) + coffee-script-source (1.12.2) + commonjs (0.2.7) + concurrent-ruby (1.0.5) + domain_name (0.5.20170404) unf (>= 0.0.5, < 1.0.0) + equalizer (0.0.11) erubis (2.7.0) - execjs (1.4.0) - multi_json (~> 1.0) - faraday (0.8.7) - multipart-post (~> 1.1) - font-awesome-rails (3.0.2.0) - railties (>= 3.1) - haml (4.0.1) + execjs (2.7.0) + ffi (1.9.18) + font-awesome-rails (4.7.0.2) + railties (>= 3.2, < 5.2) + haml (4.0.7) tilt haml-rails (0.4) actionpack (>= 3.1, < 4.1) activesupport (>= 3.1, < 4.1) haml (>= 3.1, < 4.1) railties (>= 3.1, < 4.1) - hashie (1.2.0) - hike (1.2.1) - i18n (0.6.1) - i18n_generators (1.2.1) - mechanize + hashie (3.5.7) + hike (1.2.3) + http (3.0.0) + addressable (~> 2.3) + http-cookie (~> 1.0) + http-form_data (>= 2.0.0.pre.pre2, < 3) + http_parser.rb (~> 0.6.0) + http-cookie (1.0.3) + domain_name (~> 0.5) + http-form_data (2.0.0) + http_parser.rb (0.6.0) + i18n (0.9.1) + concurrent-ruby (~> 1.0) + i18n_generators (2.1.1) rails (>= 3.0.0) journey (1.0.4) - jquery-rails (2.2.1) + jquery-rails (3.1.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - json (1.7.7) - kaminari (0.14.1) + json (1.8.6) + kaminari (0.17.0) actionpack (>= 3.0.0) activesupport (>= 3.0.0) - kgio (2.8.0) - less (2.3.1) - commonjs (~> 0.2.6) - less-rails (2.3.2) + kgio (2.11.1) + less (2.6.0) + commonjs (~> 0.2.7) + less-rails (2.6.0) actionpack (>= 3.1) - less (~> 2.3.1) - less-rails-bootstrap (2.3.2) - less-rails (~> 2.3.1) - libv8 (3.3.10.4) - mail (2.5.3) - i18n (>= 0.4.0) + less (~> 2.6.0) + less-rails-bootstrap (3.3.5.0) + less-rails (>= 2.6, <= 2.8) + libv8 (3.16.14.19) + mail (2.5.5) mime-types (~> 1.16) treetop (~> 1.4.8) - mechanize (2.6.0) - domain_name (~> 0.5, >= 0.5.1) - mime-types (~> 1.17, >= 1.17.2) - net-http-digest_auth (~> 1.1, >= 1.1.1) - net-http-persistent (~> 2.5, >= 2.5.2) - nokogiri (~> 1.4) - ntlm-http (~> 0.1, >= 0.1.1) - webrobots (>= 0.0.9, < 0.2) - method_source (0.8.1) - mime-types (1.21) - multi_json (1.7.2) - multipart-post (1.2.0) - net-http-digest_auth (1.2.1) - net-http-persistent (2.8) - nokogiri (1.5.9) - ntlm-http (0.1.1) - oauth (0.4.7) - omniauth (1.1.3) - hashie (~> 1.2) - rack - omniauth-oauth (1.0.1) + memoizable (0.4.2) + thread_safe (~> 0.3, >= 0.3.1) + method_source (0.9.0) + mime-types (1.25.1) + multi_json (1.12.2) + multipart-post (2.0.0) + naught (1.1.0) + oauth (0.5.4) + omniauth (1.4.2) + hashie (>= 1.2, < 4) + rack (>= 1.0, < 3) + omniauth-oauth (1.1.0) oauth omniauth (~> 1.0) - omniauth-twitter (0.0.15) - multi_json (~> 1.3) - omniauth-oauth (~> 1.0) - pg (0.14.1) - polyglot (0.3.3) - pry (0.9.12.2) - coderay (~> 1.0.5) - method_source (~> 0.8) - slop (~> 3.4) - rack (1.4.5) - rack-cache (1.2) + omniauth-twitter (1.4.0) + omniauth-oauth (~> 1.1) + rack + pg (0.21.0) + polyglot (0.3.5) + pry (0.11.3) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + public_suffix (3.0.1) + rack (1.4.7) + rack-cache (1.7.1) rack (>= 0.4) - rack-ssl (1.3.3) + rack-ssl (1.3.4) rack - rack-test (0.6.2) + rack-test (0.6.3) rack (>= 1.0) - rails (3.2.13) - actionmailer (= 3.2.13) - actionpack (= 3.2.13) - activerecord (= 3.2.13) - activeresource (= 3.2.13) - activesupport (= 3.2.13) + rails (3.2.22.5) + actionmailer (= 3.2.22.5) + actionpack (= 3.2.22.5) + activerecord (= 3.2.22.5) + activeresource (= 3.2.22.5) + activesupport (= 3.2.22.5) bundler (~> 1.0) - railties (= 3.2.13) - railties (3.2.13) - actionpack (= 3.2.13) - activesupport (= 3.2.13) + railties (= 3.2.22.5) + railties (3.2.22.5) + actionpack (= 3.2.22.5) + activesupport (= 3.2.22.5) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - raindrops (0.10.0) - rake (10.0.4) + raindrops (0.19.0) + rake (12.3.0) + rb-fsevent (0.10.2) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) rdoc (3.12.2) json (~> 1.4) - sass (3.2.7) + ref (2.0.0) + sass (3.5.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) settingslogic (2.0.9) - simple_oauth (0.2.0) - slop (3.4.5) - sprockets (2.2.2) + simple_oauth (0.3.1) + sprockets (2.2.3) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.7) - therubyracer (0.10.2) - libv8 (~> 3.3.10) - thor (0.18.0) - tilt (1.3.6) - treetop (1.4.12) + sqlite3 (1.3.13) + therubyracer (0.12.3) + libv8 (~> 3.16.14.15) + ref + thor (0.20.0) + thread_safe (0.3.6) + tilt (1.4.1) + treetop (1.4.15) polyglot polyglot (>= 0.3.1) - twitter (4.6.2) - faraday (~> 0.8, < 0.10) - multi_json (~> 1.0) - simple_oauth (~> 0.2) - tzinfo (0.3.37) - uglifier (1.3.0) - execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) - underscore-rails (1.4.3) - unf (0.1.1) + twitter (6.2.0) + addressable (~> 2.3) + buftok (~> 0.2.0) + equalizer (~> 0.0.11) + http (~> 3.0) + http-form_data (~> 2.0) + http_parser.rb (~> 0.6.0) + memoizable (~> 0.4.0) + multipart-post (~> 2.0) + naught (~> 1.0) + simple_oauth (~> 0.3.0) + tzinfo (0.3.53) + uglifier (4.0.2) + execjs (>= 0.3.0, < 3) + underscore-rails (1.8.3) + unf (0.1.4) unf_ext - unf_ext (0.0.6) - unicorn (4.6.2) + unf_ext (0.0.7.4) + unicorn (5.3.1) kgio (~> 2.6) - rack raindrops (~> 0.7) - webrobots (0.1.1) PLATFORMS ruby @@ -196,7 +211,7 @@ DEPENDENCIES omniauth-twitter pg pry - rails (= 3.2.13) + rails (= 3.2.22.5) sass-rails settingslogic sqlite3 @@ -205,3 +220,6 @@ DEPENDENCIES uglifier underscore-rails unicorn + +BUNDLED WITH + 1.16.0 From 480b593e624949bf7568f8c70bd778a5b02c35a9 Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 15:39:39 +0900 Subject: [PATCH 02/18] Remove `Twitter.configure` Do not start process due to `Twitter.configure` is deprecated. --- app/models/user.rb | 6 ++++-- config/initializers/twitter.rb | 4 ---- 2 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 config/initializers/twitter.rb diff --git a/app/models/user.rb b/app/models/user.rb index 21c94bd..b0f73d1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -24,8 +24,10 @@ def tweet(effect_url) begin client = Twitter::Client.new( - :oauth_token => access_token, - :oauth_token_secret => access_secret + consumer_key: Settings.twitter.consumer_key, + consumer_secret: Settings.twitter.consumer_secret, + oauth_token: access_token, + oauth_token_secret: access_secret ) client.update(message) diff --git a/config/initializers/twitter.rb b/config/initializers/twitter.rb deleted file mode 100644 index 2e95ae5..0000000 --- a/config/initializers/twitter.rb +++ /dev/null @@ -1,4 +0,0 @@ -Twitter.configure do |config| - config.consumer_key = Settings.twitter.consumer_key - config.consumer_secret = Settings.twitter.consumer_secret -end From 653e07d291738ce7b99522e958b54fb7d5c0d080 Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 15:41:31 +0900 Subject: [PATCH 03/18] execute bundle ex rake db:migrate --- db/schema.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 96bc15b..6a970d0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -51,10 +51,10 @@ t.datetime "start_at", :null => false t.datetime "end_at", :null => false t.string "cover_url" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false t.string "cover_original_url" t.string "cover_original_author" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end add_index "events", ["end_at"], :name => "index_events_on_end_at" From 09bc6a6c21e38f0f22c1f42eea19dd3509ec27e1 Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 15:47:39 +0900 Subject: [PATCH 04/18] bundle update rails --- Gemfile | 2 +- Gemfile.lock | 164 ++++++++++++++++++++++++++------------------------- 2 files changed, 84 insertions(+), 82 deletions(-) diff --git a/Gemfile b/Gemfile index 133c3e3..2edab4f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -gem "rails", "3.2.22.5" +gem "rails", "4.0.13" gem "jquery-rails" gem "haml-rails" diff --git a/Gemfile.lock b/Gemfile.lock index a239e46..747af5a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,43 +1,40 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.22.5) - actionpack (= 3.2.22.5) - mail (~> 2.5.4) - actionpack (3.2.22.5) - activemodel (= 3.2.22.5) - activesupport (= 3.2.22.5) - builder (~> 3.0.0) + actionmailer (4.0.13) + actionpack (= 4.0.13) + mail (~> 2.5, >= 2.5.4) + actionpack (4.0.13) + activesupport (= 4.0.13) + builder (~> 3.1.0) erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.5) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) + rack (~> 1.5.2) + rack-test (~> 0.6.2) active_decorator (1.0.0) - activemodel (3.2.22.5) - activesupport (= 3.2.22.5) - builder (~> 3.0.0) - activerecord (3.2.22.5) - activemodel (= 3.2.22.5) - activesupport (= 3.2.22.5) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.22.5) - activemodel (= 3.2.22.5) - activesupport (= 3.2.22.5) - activesupport (3.2.22.5) - i18n (~> 0.6, >= 0.6.4) - multi_json (~> 1.0) + activemodel (4.0.13) + activesupport (= 4.0.13) + builder (~> 3.1.0) + activerecord (4.0.13) + activemodel (= 4.0.13) + activerecord-deprecated_finders (~> 1.0.2) + activesupport (= 4.0.13) + arel (~> 4.0.0) + activerecord-deprecated_finders (1.0.4) + activesupport (4.0.13) + i18n (~> 0.6, >= 0.6.9) + minitest (~> 4.2) + multi_json (~> 1.3) + thread_safe (~> 0.1) + tzinfo (~> 0.3.37) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) - arel (3.0.3) + arel (4.0.2) buftok (0.2.0) - builder (3.0.4) + builder (3.1.4) coderay (1.1.2) - coffee-rails (3.2.2) + coffee-rails (4.2.2) coffee-script (>= 2.2.0) - railties (~> 3.2.0) + railties (>= 4.0.0) coffee-script (2.4.1) coffee-script-source execjs @@ -52,15 +49,21 @@ GEM ffi (1.9.18) font-awesome-rails (4.7.0.2) railties (>= 3.2, < 5.2) - haml (4.0.7) + haml (5.0.4) + temple (>= 0.8.0) tilt - haml-rails (0.4) - actionpack (>= 3.1, < 4.1) - activesupport (>= 3.1, < 4.1) - haml (>= 3.1, < 4.1) - railties (>= 3.1, < 4.1) + haml-rails (1.0.0) + actionpack (>= 4.0.1) + activesupport (>= 4.0.1) + haml (>= 4.0.6, < 6.0) + html2haml (>= 1.0.1) + railties (>= 4.0.1) hashie (3.5.7) - hike (1.2.3) + html2haml (2.2.0) + erubis (~> 2.7.0) + haml (>= 4.0, < 6) + nokogiri (>= 1.6.0) + ruby_parser (~> 3.5) http (3.0.0) addressable (~> 2.3) http-cookie (~> 1.0) @@ -74,33 +77,36 @@ GEM concurrent-ruby (~> 1.0) i18n_generators (2.1.1) rails (>= 3.0.0) - journey (1.0.4) jquery-rails (3.1.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - json (1.8.6) kaminari (0.17.0) actionpack (>= 3.0.0) activesupport (>= 3.0.0) kgio (2.11.1) less (2.6.0) commonjs (~> 0.2.7) - less-rails (2.6.0) - actionpack (>= 3.1) + less-rails (2.8.0) + actionpack (>= 4.0) less (~> 2.6.0) + sprockets (> 2, < 4) + tilt less-rails-bootstrap (3.3.5.0) less-rails (>= 2.6, <= 2.8) libv8 (3.16.14.19) - mail (2.5.5) - mime-types (~> 1.16) - treetop (~> 1.4.8) + mail (2.7.0) + mini_mime (>= 0.1.1) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) method_source (0.9.0) - mime-types (1.25.1) + mini_mime (1.0.0) + mini_portile2 (2.3.0) + minitest (4.7.5) multi_json (1.12.2) multipart-post (2.0.0) naught (1.1.0) + nokogiri (1.8.1) + mini_portile2 (~> 2.3.0) oauth (0.5.4) omniauth (1.4.2) hashie (>= 1.2, < 4) @@ -112,67 +118,63 @@ GEM omniauth-oauth (~> 1.1) rack pg (0.21.0) - polyglot (0.3.5) pry (0.11.3) coderay (~> 1.1.0) method_source (~> 0.9.0) public_suffix (3.0.1) - rack (1.4.7) - rack-cache (1.7.1) - rack (>= 0.4) - rack-ssl (1.3.4) - rack + rack (1.5.5) rack-test (0.6.3) rack (>= 1.0) - rails (3.2.22.5) - actionmailer (= 3.2.22.5) - actionpack (= 3.2.22.5) - activerecord (= 3.2.22.5) - activeresource (= 3.2.22.5) - activesupport (= 3.2.22.5) - bundler (~> 1.0) - railties (= 3.2.22.5) - railties (3.2.22.5) - actionpack (= 3.2.22.5) - activesupport (= 3.2.22.5) - rack-ssl (~> 1.3.2) + rails (4.0.13) + actionmailer (= 4.0.13) + actionpack (= 4.0.13) + activerecord (= 4.0.13) + activesupport (= 4.0.13) + bundler (>= 1.3.0, < 2.0) + railties (= 4.0.13) + sprockets-rails (~> 2.0) + railties (4.0.13) + actionpack (= 4.0.13) + activesupport (= 4.0.13) rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) + thor (>= 0.18.1, < 2.0) raindrops (0.19.0) rake (12.3.0) rb-fsevent (0.10.2) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) - rdoc (3.12.2) - json (~> 1.4) ref (2.0.0) + ruby_parser (3.10.1) + sexp_processor (~> 4.9) sass (3.5.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (3.2.6) - railties (~> 3.2.0) - sass (>= 3.1.10) - tilt (~> 1.3) + sass-rails (5.0.7) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) settingslogic (2.0.9) + sexp_processor (4.10.0) simple_oauth (0.3.1) - sprockets (2.2.3) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) + sprockets (3.7.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (2.3.3) + actionpack (>= 3.0) + activesupport (>= 3.0) + sprockets (>= 2.8, < 4.0) sqlite3 (1.3.13) + temple (0.8.0) therubyracer (0.12.3) libv8 (~> 3.16.14.15) ref thor (0.20.0) thread_safe (0.3.6) - tilt (1.4.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) + tilt (2.0.8) twitter (6.2.0) addressable (~> 2.3) buftok (~> 0.2.0) @@ -211,7 +213,7 @@ DEPENDENCIES omniauth-twitter pg pry - rails (= 3.2.22.5) + rails (= 4.0.13) sass-rails settingslogic sqlite3 From fd40dc4ec2cb24863535c11ce37e100e65312f0d Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 15:52:11 +0900 Subject: [PATCH 05/18] Boot on rails 4.0.13 --- config/application.rb | 7 +------ config/environments/development.rb | 5 ++--- config/environments/production.rb | 2 ++ config/environments/test.rb | 2 ++ 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/config/application.rb b/config/application.rb index 74671fe..bc87104 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,12 +1,7 @@ require File.expand_path('../boot', __FILE__) # Pick the frameworks you want: -require "active_record/railtie" -require "action_controller/railtie" -require "action_mailer/railtie" -require "active_resource/railtie" -require "sprockets/railtie" -# require "rails/test_unit/railtie" +require 'rails/all' if defined?(Bundler) # If you precompile assets before deploying to production, use this line diff --git a/config/environments/development.rb b/config/environments/development.rb index 2a54843..b03d9ea 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -6,9 +6,6 @@ # since you don't have to restart the web server when you make code changes. config.cache_classes = false - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true - # Show full error reports and disable caching config.consider_all_requests_local = true config.action_controller.perform_caching = false @@ -34,4 +31,6 @@ # Expands the lines which load the assets config.assets.debug = true + + config.eager_load = false end diff --git a/config/environments/production.rb b/config/environments/production.rb index 706f586..15bddbd 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -65,4 +65,6 @@ # Log the query plan for queries taking more than this (works # with SQLite, MySQL, and PostgreSQL) # config.active_record.auto_explain_threshold_in_seconds = 0.5 + + config.eager_load = true end diff --git a/config/environments/test.rb b/config/environments/test.rb index a430867..79c1d55 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -34,4 +34,6 @@ # Print deprecation notices to the stderr config.active_support.deprecation = :stderr + + config.eager_load = false end From 5a6bab0cd208901fac8fbe9fa75ee52009cb9756 Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 15:53:53 +0900 Subject: [PATCH 06/18] bundle update 4.1.x --- Gemfile | 2 +- Gemfile.lock | 73 ++++++++++++++++++++++++++++------------------------ 2 files changed, 40 insertions(+), 35 deletions(-) diff --git a/Gemfile b/Gemfile index 2edab4f..026a353 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -gem "rails", "4.0.13" +gem "rails", "4.1.16" gem "jquery-rails" gem "haml-rails" diff --git a/Gemfile.lock b/Gemfile.lock index 747af5a..73639e4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,36 +1,38 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.0.13) - actionpack (= 4.0.13) + actionmailer (4.1.16) + actionpack (= 4.1.16) + actionview (= 4.1.16) mail (~> 2.5, >= 2.5.4) - actionpack (4.0.13) - activesupport (= 4.0.13) - builder (~> 3.1.0) - erubis (~> 2.7.0) + actionpack (4.1.16) + actionview (= 4.1.16) + activesupport (= 4.1.16) rack (~> 1.5.2) rack-test (~> 0.6.2) + actionview (4.1.16) + activesupport (= 4.1.16) + builder (~> 3.1) + erubis (~> 2.7.0) active_decorator (1.0.0) - activemodel (4.0.13) - activesupport (= 4.0.13) - builder (~> 3.1.0) - activerecord (4.0.13) - activemodel (= 4.0.13) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.13) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.4) - activesupport (4.0.13) + activemodel (4.1.16) + activesupport (= 4.1.16) + builder (~> 3.1) + activerecord (4.1.16) + activemodel (= 4.1.16) + activesupport (= 4.1.16) + arel (~> 5.0.0) + activesupport (4.1.16) i18n (~> 0.6, >= 0.6.9) - minitest (~> 4.2) - multi_json (~> 1.3) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) thread_safe (~> 0.1) - tzinfo (~> 0.3.37) + tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) - arel (4.0.2) + arel (5.0.1.20140414130214) buftok (0.2.0) - builder (3.1.4) + builder (3.2.3) coderay (1.1.2) coffee-rails (4.2.2) coffee-script (>= 2.2.0) @@ -80,6 +82,7 @@ GEM jquery-rails (3.1.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) + json (1.8.6) kaminari (0.17.0) actionpack (>= 3.0.0) activesupport (>= 3.0.0) @@ -101,8 +104,7 @@ GEM method_source (0.9.0) mini_mime (1.0.0) mini_portile2 (2.3.0) - minitest (4.7.5) - multi_json (1.12.2) + minitest (5.10.3) multipart-post (2.0.0) naught (1.1.0) nokogiri (1.8.1) @@ -125,17 +127,19 @@ GEM rack (1.5.5) rack-test (0.6.3) rack (>= 1.0) - rails (4.0.13) - actionmailer (= 4.0.13) - actionpack (= 4.0.13) - activerecord (= 4.0.13) - activesupport (= 4.0.13) + rails (4.1.16) + actionmailer (= 4.1.16) + actionpack (= 4.1.16) + actionview (= 4.1.16) + activemodel (= 4.1.16) + activerecord (= 4.1.16) + activesupport (= 4.1.16) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.13) + railties (= 4.1.16) sprockets-rails (~> 2.0) - railties (4.0.13) - actionpack (= 4.0.13) - activesupport (= 4.0.13) + railties (4.1.16) + actionpack (= 4.1.16) + activesupport (= 4.1.16) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.19.0) @@ -186,7 +190,8 @@ GEM multipart-post (~> 2.0) naught (~> 1.0) simple_oauth (~> 0.3.0) - tzinfo (0.3.53) + tzinfo (1.2.4) + thread_safe (~> 0.1) uglifier (4.0.2) execjs (>= 0.3.0, < 3) underscore-rails (1.8.3) @@ -213,7 +218,7 @@ DEPENDENCIES omniauth-twitter pg pry - rails (= 4.0.13) + rails (= 4.1.16) sass-rails settingslogic sqlite3 From a020a4e0660ff74dbfd6d7762fec89a1bc250994 Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 15:54:56 +0900 Subject: [PATCH 07/18] bundle update rails 4.2.x --- Gemfile | 4 +- Gemfile.lock | 129 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 85 insertions(+), 48 deletions(-) diff --git a/Gemfile b/Gemfile index 026a353..207da9b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,8 @@ source "https://rubygems.org" -gem "rails", "4.1.16" +ruby "2.4.2" + +gem "rails", "4.2.10" gem "jquery-rails" gem "haml-rails" diff --git a/Gemfile.lock b/Gemfile.lock index 73639e4..d4c60bf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,36 +1,44 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.1.16) - actionpack (= 4.1.16) - actionview (= 4.1.16) + actionmailer (4.2.10) + actionpack (= 4.2.10) + actionview (= 4.2.10) + activejob (= 4.2.10) mail (~> 2.5, >= 2.5.4) - actionpack (4.1.16) - actionview (= 4.1.16) - activesupport (= 4.1.16) - rack (~> 1.5.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.10) + actionview (= 4.2.10) + activesupport (= 4.2.10) + rack (~> 1.6) rack-test (~> 0.6.2) - actionview (4.1.16) - activesupport (= 4.1.16) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.10) + activesupport (= 4.2.10) builder (~> 3.1) erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.3) active_decorator (1.0.0) - activemodel (4.1.16) - activesupport (= 4.1.16) + activejob (4.2.10) + activesupport (= 4.2.10) + globalid (>= 0.3.0) + activemodel (4.2.10) + activesupport (= 4.2.10) builder (~> 3.1) - activerecord (4.1.16) - activemodel (= 4.1.16) - activesupport (= 4.1.16) - arel (~> 5.0.0) - activesupport (4.1.16) - i18n (~> 0.6, >= 0.6.9) - json (~> 1.7, >= 1.7.7) + activerecord (4.2.10) + activemodel (= 4.2.10) + activesupport (= 4.2.10) + arel (~> 6.0) + activesupport (4.2.10) + i18n (~> 0.7) minitest (~> 5.1) - thread_safe (~> 0.1) + thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) - arel (5.0.1.20140414130214) + arel (6.0.4) buftok (0.2.0) builder (3.2.3) coderay (1.1.2) @@ -43,6 +51,7 @@ GEM coffee-script-source (1.12.2) commonjs (0.2.7) concurrent-ruby (1.0.5) + crass (1.0.3) domain_name (0.5.20170404) unf (>= 0.0.5, < 1.0.0) equalizer (0.0.11) @@ -51,6 +60,8 @@ GEM ffi (1.9.18) font-awesome-rails (4.7.0.2) railties (>= 3.2, < 5.2) + globalid (0.4.1) + activesupport (>= 4.2.0) haml (5.0.4) temple (>= 0.8.0) tilt @@ -79,13 +90,22 @@ GEM concurrent-ruby (~> 1.0) i18n_generators (2.1.1) rails (>= 3.0.0) - jquery-rails (3.1.4) - railties (>= 3.0, < 5.0) + jquery-rails (4.3.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (1.8.6) - kaminari (0.17.0) - actionpack (>= 3.0.0) - activesupport (>= 3.0.0) + kaminari (1.1.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.1.1) + kaminari-activerecord (= 1.1.1) + kaminari-core (= 1.1.1) + kaminari-actionview (1.1.1) + actionview + kaminari-core (= 1.1.1) + kaminari-activerecord (1.1.1) + activerecord + kaminari-core (= 1.1.1) + kaminari-core (1.1.1) kgio (2.11.1) less (2.6.0) commonjs (~> 0.2.7) @@ -97,6 +117,9 @@ GEM less-rails-bootstrap (3.3.5.0) less-rails (>= 2.6, <= 2.8) libv8 (3.16.14.19) + loofah (2.1.1) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) mail (2.7.0) mini_mime (>= 0.1.1) memoizable (0.4.2) @@ -110,9 +133,9 @@ GEM nokogiri (1.8.1) mini_portile2 (~> 2.3.0) oauth (0.5.4) - omniauth (1.4.2) - hashie (>= 1.2, < 4) - rack (>= 1.0, < 3) + omniauth (1.7.1) + hashie (>= 3.4.6, < 3.6.0) + rack (>= 1.6.2, < 3) omniauth-oauth (1.1.0) oauth omniauth (~> 1.0) @@ -124,22 +147,31 @@ GEM coderay (~> 1.1.0) method_source (~> 0.9.0) public_suffix (3.0.1) - rack (1.5.5) + rack (1.6.8) rack-test (0.6.3) rack (>= 1.0) - rails (4.1.16) - actionmailer (= 4.1.16) - actionpack (= 4.1.16) - actionview (= 4.1.16) - activemodel (= 4.1.16) - activerecord (= 4.1.16) - activesupport (= 4.1.16) + rails (4.2.10) + actionmailer (= 4.2.10) + actionpack (= 4.2.10) + actionview (= 4.2.10) + activejob (= 4.2.10) + activemodel (= 4.2.10) + activerecord (= 4.2.10) + activesupport (= 4.2.10) bundler (>= 1.3.0, < 2.0) - railties (= 4.1.16) - sprockets-rails (~> 2.0) - railties (4.1.16) - actionpack (= 4.1.16) - activesupport (= 4.1.16) + railties (= 4.2.10) + 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) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + railties (4.2.10) + actionpack (= 4.2.10) + activesupport (= 4.2.10) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.19.0) @@ -167,10 +199,10 @@ GEM sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (2.3.3) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (>= 2.8, < 4.0) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) sqlite3 (1.3.13) temple (0.8.0) therubyracer (0.12.3) @@ -218,7 +250,7 @@ DEPENDENCIES omniauth-twitter pg pry - rails (= 4.1.16) + rails (= 4.2.10) sass-rails settingslogic sqlite3 @@ -228,5 +260,8 @@ DEPENDENCIES underscore-rails unicorn +RUBY VERSION + ruby 2.4.2p198 + BUNDLED WITH 1.16.0 From cc9ad540c83458b90d342f8af99cc08bf71cda34 Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 15:59:37 +0900 Subject: [PATCH 08/18] Remove deprecated api --- config/environments/development.rb | 3 --- config/environments/test.rb | 3 --- 2 files changed, 6 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index b03d9ea..e80fa19 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -19,9 +19,6 @@ # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin - # Raise exception on mass assignment protection for Active Record models - config.active_record.mass_assignment_sanitizer = :strict - # Log the query plan for queries taking more than this (works # with SQLite, MySQL, and PostgreSQL) config.active_record.auto_explain_threshold_in_seconds = 0.5 diff --git a/config/environments/test.rb b/config/environments/test.rb index 79c1d55..97da6e3 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -29,9 +29,6 @@ # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test - # Raise exception on mass assignment protection for Active Record models - config.active_record.mass_assignment_sanitizer = :strict - # Print deprecation notices to the stderr config.active_support.deprecation = :stderr From b71a192ea83d9223d7e767792bf4a7d6d1fafe57 Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 16:03:50 +0900 Subject: [PATCH 09/18] Remove less-rails-bootstrap --- Gemfile | 2 +- Gemfile.lock | 19 ++++++++----------- .../bootstrap_and_overrides.css.less | 1 - .../bootstrap_and_overrides.css.scss | 1 + 4 files changed, 10 insertions(+), 13 deletions(-) delete mode 100644 app/assets/stylesheets/bootstrap_and_overrides.css.less create mode 100644 app/assets/stylesheets/bootstrap_and_overrides.css.scss diff --git a/Gemfile b/Gemfile index 207da9b..7bbdf0d 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ gem "jquery-rails" gem "haml-rails" gem "underscore-rails" gem "font-awesome-rails" -gem "less-rails-bootstrap" +gem "bootstrap" gem "therubyracer" gem "kaminari" diff --git a/Gemfile.lock b/Gemfile.lock index d4c60bf..2df737c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,6 +39,12 @@ GEM addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) arel (6.0.4) + autoprefixer-rails (7.2.3) + execjs + bootstrap (4.0.0.beta2.1) + autoprefixer-rails (>= 6.0.3) + popper_js (>= 1.12.3, < 2) + sass (>= 3.5.2) buftok (0.2.0) builder (3.2.3) coderay (1.1.2) @@ -49,7 +55,6 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - commonjs (0.2.7) concurrent-ruby (1.0.5) crass (1.0.3) domain_name (0.5.20170404) @@ -107,15 +112,6 @@ GEM kaminari-core (= 1.1.1) kaminari-core (1.1.1) kgio (2.11.1) - less (2.6.0) - commonjs (~> 0.2.7) - less-rails (2.8.0) - actionpack (>= 4.0) - less (~> 2.6.0) - sprockets (> 2, < 4) - tilt - less-rails-bootstrap (3.3.5.0) - less-rails (>= 2.6, <= 2.8) libv8 (3.16.14.19) loofah (2.1.1) crass (~> 1.0.2) @@ -143,6 +139,7 @@ GEM omniauth-oauth (~> 1.1) rack pg (0.21.0) + popper_js (1.12.9) pry (0.11.3) coderay (~> 1.1.0) method_source (~> 0.9.0) @@ -239,13 +236,13 @@ PLATFORMS DEPENDENCIES active_decorator + bootstrap coffee-rails font-awesome-rails haml-rails i18n_generators jquery-rails kaminari - less-rails-bootstrap omniauth omniauth-twitter pg diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less deleted file mode 100644 index c52c529..0000000 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ /dev/null @@ -1 +0,0 @@ -@import "twitter/bootstrap/bootstrap"; diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.scss b/app/assets/stylesheets/bootstrap_and_overrides.css.scss new file mode 100644 index 0000000..cbd46a7 --- /dev/null +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.scss @@ -0,0 +1 @@ +@import "bootstrap"; From a18812bec5f7713764d6897b99d4c82a7252ba77 Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 16:41:14 +0900 Subject: [PATCH 10/18] execute `rails _4.2.10_ new kceffect` --- .gitignore | 13 ++++++------- Gemfile | 27 +++++++++++++++------------ Gemfile.lock | 35 ++++++++++++++++++++++++----------- Rakefile | 3 +-- 4 files changed, 46 insertions(+), 32 deletions(-) diff --git a/.gitignore b/.gitignore index b910a6f..050c9d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,17 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. +# See https://help.github.com/articles/ignoring-files for more about ignoring files. # # If you find yourself ignoring temporary files generated by your text editor # or operating system, you probably want to add a global ignore instead: -# git config --global core.excludesfile ~/.gitignore_global +# git config --global core.excludesfile '~/.gitignore_global' -# Ignore bundler config +# Ignore bundler config. /.bundle # Ignore the default SQLite database. /db/*.sqlite3 +/db/*.sqlite3-journal # Ignore all logfiles and tempfiles. -/log/*.log +/log/* +!/log/.keep /tmp - -# Ignore rbenv local setting -.rbenv-version diff --git a/Gemfile b/Gemfile index 7bbdf0d..afb2a0b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,16 +1,20 @@ -source "https://rubygems.org" +source 'https://rubygems.org' ruby "2.4.2" -gem "rails", "4.2.10" +gem 'rails', '4.2.10' + +gem 'sqlite3' +gem 'sass-rails', '~> 5.0' +gem 'uglifier', '>= 1.3.0' +gem 'coffee-rails', '~> 4.1.0' +gem 'jquery-rails' +gem 'jbuilder', '~> 2.0' -gem "jquery-rails" gem "haml-rails" gem "underscore-rails" gem "font-awesome-rails" gem "bootstrap" -gem "therubyracer" - gem "kaminari" gem "i18n_generators" gem "active_decorator" @@ -19,15 +23,14 @@ gem "omniauth" gem "omniauth-twitter" gem "twitter" -group :assets do - gem "sass-rails" - gem "coffee-rails" - gem "uglifier" +group :development, :test do + gem 'byebug' + gem 'pry' end -group :development, :test do - gem "sqlite3" - gem "pry" +group :development do + gem 'web-console', '~> 2.0' + gem 'spring' end group :production do diff --git a/Gemfile.lock b/Gemfile.lock index 2df737c..6c51ce2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -41,22 +41,26 @@ GEM arel (6.0.4) autoprefixer-rails (7.2.3) execjs + binding_of_caller (0.7.3) + debug_inspector (>= 0.0.1) bootstrap (4.0.0.beta2.1) autoprefixer-rails (>= 6.0.3) popper_js (>= 1.12.3, < 2) sass (>= 3.5.2) buftok (0.2.0) builder (3.2.3) + byebug (9.1.0) coderay (1.1.2) - coffee-rails (4.2.2) + coffee-rails (4.1.1) coffee-script (>= 2.2.0) - railties (>= 4.0.0) + railties (>= 4.0.0, < 5.1.x) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.12.2) concurrent-ruby (1.0.5) crass (1.0.3) + debug_inspector (0.0.3) domain_name (0.5.20170404) unf (>= 0.0.5, < 1.0.0) equalizer (0.0.11) @@ -95,6 +99,9 @@ GEM concurrent-ruby (~> 1.0) i18n_generators (2.1.1) rails (>= 3.0.0) + jbuilder (2.7.0) + activesupport (>= 4.2.0) + multi_json (>= 1.2) jquery-rails (4.3.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) @@ -112,7 +119,6 @@ GEM kaminari-core (= 1.1.1) kaminari-core (1.1.1) kgio (2.11.1) - libv8 (3.16.14.19) loofah (2.1.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -124,6 +130,7 @@ GEM mini_mime (1.0.0) mini_portile2 (2.3.0) minitest (5.10.3) + multi_json (1.12.2) multipart-post (2.0.0) naught (1.1.0) nokogiri (1.8.1) @@ -176,7 +183,6 @@ GEM rb-fsevent (0.10.2) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) - ref (2.0.0) ruby_parser (3.10.1) sexp_processor (~> 4.9) sass (3.5.4) @@ -193,6 +199,8 @@ GEM settingslogic (2.0.9) sexp_processor (4.10.0) simple_oauth (0.3.1) + spring (2.0.2) + activesupport (>= 4.2) sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -202,9 +210,6 @@ GEM sprockets (>= 3.0.0) sqlite3 (1.3.13) temple (0.8.0) - therubyracer (0.12.3) - libv8 (~> 3.16.14.15) - ref thor (0.20.0) thread_safe (0.3.6) tilt (2.0.8) @@ -230,6 +235,11 @@ GEM unicorn (5.3.1) kgio (~> 2.6) raindrops (~> 0.7) + web-console (2.3.0) + activemodel (>= 4.0) + binding_of_caller (>= 0.7.2) + railties (>= 4.0) + sprockets-rails (>= 2.0, < 4.0) PLATFORMS ruby @@ -237,10 +247,12 @@ PLATFORMS DEPENDENCIES active_decorator bootstrap - coffee-rails + byebug + coffee-rails (~> 4.1.0) font-awesome-rails haml-rails i18n_generators + jbuilder (~> 2.0) jquery-rails kaminari omniauth @@ -248,14 +260,15 @@ DEPENDENCIES pg pry rails (= 4.2.10) - sass-rails + sass-rails (~> 5.0) settingslogic + spring sqlite3 - therubyracer twitter - uglifier + uglifier (>= 1.3.0) underscore-rails unicorn + web-console (~> 2.0) RUBY VERSION ruby 2.4.2p198 diff --git a/Rakefile b/Rakefile index f4c7e3f..ba6b733 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,6 @@ -#!/usr/bin/env rake # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) -Kceffect::Application.load_tasks +Rails.application.load_tasks From eb99348a1e0a0a0f588b670d6341e1b151e16afe Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 16:43:35 +0900 Subject: [PATCH 11/18] Follow up rails 4.2.x --- README | 1 - README.md | 1 + app/assets/config/manifest.js | 3 + app/assets/images/.keep | 0 app/assets/javascripts/application.js | 12 +++ app/assets/stylesheets/application.css | 12 ++- app/controllers/application_controller.rb | 7 +- app/controllers/concerns/.keep | 0 app/mailers/.keep | 0 app/models/.keep | 0 app/models/concerns/.keep | 0 bin/bundle | 3 + bin/rails | 9 ++ bin/rake | 9 ++ bin/setup | 29 +++++++ bin/spring | 17 ++++ bin/update | 29 +++++++ bin/yarn | 11 +++ config.ru | 4 +- config/application.rb | 45 ++-------- config/boot.rb | 5 +- config/database.yml | 16 ++-- config/environment.rb | 6 +- config/environments/development.rb | 38 +++++---- config/environments/production.rb | 83 ++++++++++--------- config/environments/test.rb | 32 ++++--- .../application_controller_renderer.rb | 8 ++ config/initializers/assets.rb | 11 +++ config/initializers/cookies_serializer.rb | 3 + .../initializers/filter_parameter_logging.rb | 4 + config/initializers/inflections.rb | 11 +-- config/initializers/mime_types.rb | 1 - config/initializers/session_store.rb | 7 +- .../to_time_preserves_timezone.rb | 10 +++ config/initializers/wrap_parameters.rb | 12 +-- config/locales/en.yml | 22 ++++- config/secrets.yml | 22 +++++ config/spring.rb | 6 ++ lib/assets/.keep | 0 lib/tasks/.keep | 0 log/.keep | 0 public/404.html | 67 ++++++++++++--- public/422.html | 67 ++++++++++++--- public/500.html | 65 ++++++++++++--- public/apple-touch-icon-precomposed.png | 0 public/apple-touch-icon.png | 0 public/robots.txt | 4 +- vendor/.keep | 0 vendor/assets/javascripts/.keep | 0 vendor/assets/stylesheets/.keep | 0 50 files changed, 505 insertions(+), 187 deletions(-) create mode 100644 README.md create mode 100644 app/assets/config/manifest.js create mode 100644 app/assets/images/.keep create mode 100644 app/controllers/concerns/.keep create mode 100644 app/mailers/.keep create mode 100644 app/models/.keep create mode 100644 app/models/concerns/.keep create mode 100755 bin/bundle create mode 100755 bin/rails create mode 100755 bin/rake create mode 100755 bin/setup create mode 100755 bin/spring create mode 100755 bin/update create mode 100755 bin/yarn create mode 100644 config/initializers/application_controller_renderer.rb create mode 100644 config/initializers/assets.rb create mode 100644 config/initializers/cookies_serializer.rb create mode 100644 config/initializers/filter_parameter_logging.rb create mode 100644 config/initializers/to_time_preserves_timezone.rb create mode 100644 config/secrets.yml create mode 100644 config/spring.rb create mode 100644 lib/assets/.keep create mode 100644 lib/tasks/.keep create mode 100644 log/.keep create mode 100644 public/apple-touch-icon-precomposed.png create mode 100644 public/apple-touch-icon.png create mode 100644 vendor/.keep create mode 100644 vendor/assets/javascripts/.keep create mode 100644 vendor/assets/stylesheets/.keep diff --git a/README b/README index 7588358..e69de29 100644 --- a/README +++ b/README @@ -1 +0,0 @@ -http://kceffect.org/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..7588358 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +http://kceffect.org/ diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 0000000..b16e53d --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,3 @@ +//= link_tree ../images +//= link_directory ../javascripts .js +//= link_directory ../stylesheets .css diff --git a/app/assets/images/.keep b/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index e2778b0..c9f7ac6 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -1,3 +1,15 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// //= require jquery //= require jquery_ujs //= require underscore diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 6748251..145eca7 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,8 +1,18 @@ /* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any styles + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new + * file per style scope. + * *= require_self *= require bootstrap_and_overrides *= require font-awesome - *= require kceffect *= require contributions *= require effects diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a2f255f..aa10fae 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,8 +1,9 @@ class ApplicationController < ActionController::Base - before_filter :please_sign_in_again - - protect_from_forgery + # Prevent CSRF attacks by raising an exception. + # For APIs, you may want to use :null_session instead. + protect_from_forgery with: :exception + before_filter :please_sign_in_again helper_method :current_user, :signed_in?, :sign_out! protected diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/mailers/.keep b/app/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/.keep b/app/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..0138d79 --- /dev/null +++ b/bin/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..d87d5f5 --- /dev/null +++ b/bin/rake @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..acdb2c1 --- /dev/null +++ b/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/bin/spring b/bin/spring new file mode 100755 index 0000000..fb2ec2e --- /dev/null +++ b/bin/spring @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. + +unless defined?(Spring) + require 'rubygems' + require 'bundler' + + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + spring = lockfile.specs.detect { |spec| spec.name == "spring" } + if spring + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version + require 'spring/binstub' + end +end diff --git a/bin/update b/bin/update new file mode 100755 index 0000000..a8e4462 --- /dev/null +++ b/bin/update @@ -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 diff --git a/bin/yarn b/bin/yarn new file mode 100755 index 0000000..c2bacef --- /dev/null +++ b/bin/yarn @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby +VENDOR_PATH = File.expand_path('..', __dir__) +Dir.chdir(VENDOR_PATH) do + begin + exec "yarnpkg #{ARGV.join(" ")}" + rescue Errno::ENOENT + $stderr.puts "Yarn executable was not detected in the system." + $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" + exit 1 + end +end diff --git a/config.ru b/config.ru index 3c41fa4..bd83b25 100644 --- a/config.ru +++ b/config.ru @@ -1,4 +1,4 @@ # This file is used by Rack-based servers to start the application. -require ::File.expand_path('../config/environment', __FILE__) -run Kceffect::Application +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/config/application.rb b/config/application.rb index bc87104..db4abfe 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,14 +1,10 @@ require File.expand_path('../boot', __FILE__) -# Pick the frameworks you want: require 'rails/all' -if defined?(Bundler) - # If you precompile assets before deploying to production, use this line - Bundler.require(*Rails.groups(:assets => %w(development test))) - # If you want your assets lazily compiled in production, use this line - # Bundler.require(:default, :assets, Rails.env) -end +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) module Kceffect class Application < Rails::Application @@ -16,17 +12,6 @@ class Application < Rails::Application # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. - # Custom directories with classes and modules you want to be autoloadable. - # config.autoload_paths += %W(#{config.root}/extras) - config.autoload_paths += %W(#{config.root}/lib/validators) - - # Only load the plugins named here, in the order given (default is alphabetical). - # :all can be used as a placeholder for all plugins not explicitly named. - # config.plugins = [ :exception_notification, :ssl_requirement, :all ] - - # Activate observers that should always be running. - # config.active_record.observers = :cacher, :garbage_collector, :forum_observer - # 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)' @@ -36,27 +21,7 @@ class Application < Rails::Application # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] config.i18n.default_locale = 'ja' - # Configure the default encoding used in templates for Ruby 1.9. - config.encoding = "utf-8" - - # Configure sensitive parameters which will be filtered from the log file. - config.filter_parameters += [:password] - - # Use SQL instead of Active Record's schema dumper when creating the database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql - - # Enforce whitelist mode for mass assignment. - # This will create an empty whitelist of attributes available for mass-assignment for all models - # in your app. As such, your models will need to explicitly whitelist or blacklist accessible - # parameters by using an attr_accessible or attr_protected declaration. - # config.active_record.whitelist_attributes = true - - # Enable the asset pipeline - config.assets.enabled = true - - # Version of your assets, change this if you want to expire all your assets - config.assets.version = '1.0' + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true end end diff --git a/config/boot.rb b/config/boot.rb index 4489e58..6b750f0 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,6 +1,3 @@ -require 'rubygems' - -# Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/config/database.yml b/config/database.yml index 51a4dd4..1c1a37c 100644 --- a/config/database.yml +++ b/config/database.yml @@ -3,23 +3,23 @@ # # Ensure the SQLite 3 gem is defined in your Gemfile # gem 'sqlite3' -development: +# +default: &default adapter: sqlite3 - database: db/development.sqlite3 pool: 5 timeout: 5000 +development: + <<: *default + database: db/development.sqlite3 + # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: - adapter: sqlite3 + <<: *default database: db/test.sqlite3 - pool: 5 - timeout: 5000 production: - adapter: sqlite3 + <<: *default database: db/production.sqlite3 - pool: 5 - timeout: 5000 diff --git a/config/environment.rb b/config/environment.rb index 47e9ce2..ee8d90d 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,5 +1,5 @@ -# Load the rails application +# Load the Rails application. require File.expand_path('../application', __FILE__) -# Initialize the rails application -Kceffect::Application.initialize! +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index e80fa19..b55e214 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,33 +1,41 @@ -Kceffect::Application.configure do - # Settings specified here will take precedence over those in config/application.rb +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. config.cache_classes = false - # Show full error reports and disable caching + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false - # 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 - # Print deprecation notices to the Rails logger + # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log - # Only use best-standards-support built into browsers - config.action_dispatch.best_standards_support = :builtin + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load - # Log the query plan for queries taking more than this (works - # with SQLite, MySQL, and PostgreSQL) - config.active_record.auto_explain_threshold_in_seconds = 0.5 + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true - # Do not compress assets - config.assets.compress = false + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true - # Expands the lines which load the assets - config.assets.debug = true + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true - config.eager_load = false + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index 15bddbd..5c1b32e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,70 +1,79 @@ -Kceffect::Application.configure do - # Settings specified here will take precedence over those in config/application.rb +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. - # Code is not reloaded between requests + # Code is not reloaded between requests. config.cache_classes = true - # Full error reports are disabled and caching is turned on + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false config.action_controller.perform_caching = true - # Disable Rails's static asset server (Apache or nginx will already do this) - config.serve_static_assets = false + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like + # NGINX, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? - # Compress JavaScripts and CSS - config.assets.compress = true + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass - # Don't fallback to assets pipeline if a precompiled asset is missed - # config.assets.compile = false - config.assets.compile = true + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false - # Generate digests for assets URLs + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. config.assets.digest = true - # Defaults to Rails.root.join("public/assets") - # config.assets.manifest = YOUR_PATH + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb - # 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-Accel-Redirect' # for nginx + # 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-Accel-Redirect' # for NGINX # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # See everything in the log (default is :info) - # config.log_level = :debug + # Use the lowest log level to ensure availability of diagnostic information + # 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 ] - # Use a different logger for distributed setups + # 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 - # Enable serving of images, stylesheets, and JavaScripts from an asset server - # config.action_controller.asset_host = "http://assets.example.com" + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' - # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) - # config.assets.precompile += %w( search.js ) - - # Disable delivery errors, bad email addresses will be ignored + # 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 = false - # Enable threaded mode - # config.threadsafe! - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation can not be found) + # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - # Send deprecation notices to registered listeners + # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify - # Log the query plan for queries taking more than this (works - # with SQLite, MySQL, and PostgreSQL) - # config.active_record.auto_explain_threshold_in_seconds = 0.5 + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new - config.eager_load = true + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false end diff --git a/config/environments/test.rb b/config/environments/test.rb index 97da6e3..1c19f08 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,5 +1,5 @@ -Kceffect::Application.configure do - # Settings specified here will take precedence over those in config/application.rb +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that @@ -7,30 +7,36 @@ # and recreated between test runs. Don't rely on the data there! config.cache_classes = true - # Configure static asset server for tests with Cache-Control for performance - config.serve_static_assets = true - config.static_cache_control = "public, max-age=3600" + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false - # Log error messages when you accidentally call methods on nil - config.whiny_nils = true + # Configure static file server for tests with Cache-Control for performance. + config.serve_static_files = true + config.static_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.action_controller.perform_caching = false - # Raise exceptions instead of rendering exception templates + # Raise exceptions instead of rendering exception templates. config.action_dispatch.show_exceptions = false - # Disable request forgery protection in test environment - config.action_controller.allow_forgery_protection = false + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test - # Print deprecation notices to the stderr + # Randomize the order test cases are executed. + config.active_support.test_order = :random + + # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr - config.eager_load = false + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true end diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb new file mode 100644 index 0000000..89d2efa --- /dev/null +++ b/config/initializers/application_controller_renderer.rb @@ -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 diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 0000000..01ef3e6 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +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. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7f70458 --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 5d8d9be..ac033bf 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,15 +1,16 @@ # Be sure to restart your server when you modify this file. -# Add new inflection rules using the following format -# (all these examples are active by default): -# ActiveSupport::Inflector.inflections do |inflect| +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| # inflect.plural /^(ox)$/i, '\1en' # inflect.singular /^(ox)en/i, '\1' # inflect.irregular 'person', 'people' # inflect.uncountable %w( fish sheep ) # end -# + # These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections do |inflect| +# ActiveSupport::Inflector.inflections(:en) do |inflect| # inflect.acronym 'RESTful' # end diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 72aca7e..dc18996 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -2,4 +2,3 @@ # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 3d0db7e..79f2580 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,8 +1,3 @@ # Be sure to restart your server when you modify this file. -Kceffect::Application.config.session_store :cookie_store, key: '_kceffect_session' - -# Use the database for sessions instead of the cookie-based default, -# which shouldn't be used to store highly confidential information -# (create the session table with "rails generate session_migration") -# Kceffect::Application.config.session_store :active_record_store +Rails.application.config.session_store :cookie_store, key: '_kceffect_session' diff --git a/config/initializers/to_time_preserves_timezone.rb b/config/initializers/to_time_preserves_timezone.rb new file mode 100644 index 0000000..8674be3 --- /dev/null +++ b/config/initializers/to_time_preserves_timezone.rb @@ -0,0 +1,10 @@ +# Be sure to restart your server when you modify this file. + +# Preserve the timezone of the receiver when calling to `to_time`. +# Ruby 2.4 will change the behavior of `to_time` to preserve the timezone +# when converting to an instance of `Time` instead of the previous behavior +# of converting to the local system timezone. +# +# Rails 5.0 introduced this config option so that apps made with earlier +# versions of Rails are not affected when upgrading. +ActiveSupport.to_time_preserves_timezone = true diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index 999df20..33725e9 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -1,14 +1,14 @@ # Be sure to restart your server when you modify this file. -# + # This file contains settings for ActionController::ParamsWrapper which # is enabled by default. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) end -# Disable root element in JSON by default. -ActiveSupport.on_load(:active_record) do - self.include_root_in_json = false -end +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/config/locales/en.yml b/config/locales/en.yml index 179c14c..0653957 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,5 +1,23 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. en: hello: "Hello world" diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 0000000..edfdde9 --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: 74195a9e358d43abca2f57cfb1915296187b08ce2151519b4282e3bd8045115797805418b2cee789a7c8fffc5c6cd35cc45f48aa30a1ece9281ee11807879c75 + +test: + secret_key_base: 344944d0b3d5f4df4ed3228903ec8f2a719ed123e280d19831e0a6d13413057918678c2dd1415cd7f06224ea7555531a278ce43efea7c050e2345feac2b7f6c4 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/config/spring.rb b/config/spring.rb new file mode 100644 index 0000000..c9119b4 --- /dev/null +++ b/config/spring.rb @@ -0,0 +1,6 @@ +%w( + .ruby-version + .rbenv-vars + tmp/restart.txt + tmp/caching-dev.txt +).each { |path| Spring.watch(path) } diff --git a/lib/assets/.keep b/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/lib/tasks/.keep b/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/log/.keep b/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/public/404.html b/public/404.html index 9a48320..b612547 100644 --- a/public/404.html +++ b/public/404.html @@ -2,25 +2,66 @@ The page you were looking for doesn't exist (404) -
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

diff --git a/public/422.html b/public/422.html index 83660ab..a21f82b 100644 --- a/public/422.html +++ b/public/422.html @@ -2,25 +2,66 @@ The change you wanted was rejected (422) -
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

diff --git a/public/500.html b/public/500.html index f3648a0..061abc5 100644 --- a/public/500.html +++ b/public/500.html @@ -2,24 +2,65 @@ We're sorry, but something went wrong (500) -
-

We're sorry, but something went wrong.

+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

diff --git a/public/apple-touch-icon-precomposed.png b/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..e69de29 diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..e69de29 diff --git a/public/robots.txt b/public/robots.txt index 085187f..3c9c7c0 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,5 +1,5 @@ -# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file # # To ban all spiders from the entire site uncomment the next two lines: -# User-Agent: * +# User-agent: * # Disallow: / diff --git a/vendor/.keep b/vendor/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/assets/javascripts/.keep b/vendor/assets/javascripts/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/assets/stylesheets/.keep b/vendor/assets/stylesheets/.keep new file mode 100644 index 0000000..e69de29 From 0d7d841e9283ac2c0a4e59fff1f3300a8d736838 Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 18:19:59 +0900 Subject: [PATCH 12/18] Update config/database.yml with postgresql MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 本番のデータを見つつちゃんとアプリケーションを復元出来るか確かめたい。 そのため開発環境のデータベースも本番と揃えるようにしました。 --- config/database.yml | 78 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 69 insertions(+), 9 deletions(-) diff --git a/config/database.yml b/config/database.yml index 1c1a37c..e3cd2bb 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,25 +1,85 @@ -# SQLite version 3.x -# gem install sqlite3 +# PostgreSQL. Versions 8.2 and up are supported. # -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' +# Install the pg driver: +# gem install pg +# On OS X with Homebrew: +# gem install pg -- --with-pg-config=/usr/local/bin/pg_config +# On OS X with MacPorts: +# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config +# On Windows: +# gem install pg +# Choose the win32 build. +# Install PostgreSQL and put its /bin directory on your path. +# +# Configure Using Gemfile +# gem 'pg' # default: &default - adapter: sqlite3 + adapter: postgresql + encoding: unicode + # For details on connection pooling, see rails configuration guide + # http://guides.rubyonrails.org/configuring.html#database-pooling pool: 5 - timeout: 5000 development: <<: *default - database: db/development.sqlite3 + database: kceffect_development + + # The specified database role being used to connect to postgres. + # To create additional roles in postgres see `$ createuser --help`. + # When left blank, postgres will use the default role. This is + # the same name as the operating system user that initialized the database. + #username: + + # The password associated with the postgres role (username). + #password: + + # Connect on a TCP socket. Omitted by default since the client uses a + # domain socket that doesn't need configuration. Windows does not have + # domain sockets, so uncomment these lines. + #host: localhost + + # The TCP port the server listens on. Defaults to 5432. + # If your server runs on a different port number, change accordingly. + #port: 5432 + + # Schema search path. The server defaults to $user,public + #schema_search_path: myapp,sharedapp,public + + # Minimum log levels, in increasing order: + # debug5, debug4, debug3, debug2, debug1, + # log, notice, warning, error, fatal, and panic + # Defaults to warning. + #min_messages: notice # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default - database: db/test.sqlite3 + database: kceffect_test +# As with config/secrets.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password as a unix environment variable when you boot +# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full rundown on how to provide these environment variables in a +# production deployment. +# +# On Heroku and other platform providers, you may have a full connection URL +# available as an environment variable. For example: +# +# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" +# +# You can use this database configuration with: +# +# production: +# url: <%= ENV['DATABASE_URL'] %> +# production: <<: *default - database: db/production.sqlite3 + database: kceffect + username: + password: <%= ENV['_DATABASE_PASSWORD'] %> From eb6d2da69be1c90007b3b66932c2c743ee7f59c4 Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 18:55:10 +0900 Subject: [PATCH 13/18] attr_accessible :arrow_right: :see_no_evil: --- app/models/contribution.rb | 2 -- app/models/effect.rb | 2 -- app/models/event.rb | 2 -- app/models/favorite.rb | 2 -- app/models/tag.rb | 2 -- app/models/tagging.rb | 2 -- app/models/user.rb | 2 -- 7 files changed, 14 deletions(-) diff --git a/app/models/contribution.rb b/app/models/contribution.rb index c37ae0a..526f006 100644 --- a/app/models/contribution.rb +++ b/app/models/contribution.rb @@ -2,8 +2,6 @@ class Contribution < ActiveRecord::Base KINDS = [:attendee, :staff, :talker, :watcher, :dorar] - attr_accessible :attendee, :dorar, :event_id, :staff, :talker, :user_id, :watcher - validates :user_id, :presence => true validates :event_id, :presence => true diff --git a/app/models/effect.rb b/app/models/effect.rb index ef33082..a147e04 100644 --- a/app/models/effect.rb +++ b/app/models/effect.rb @@ -1,6 +1,4 @@ class Effect < ActiveRecord::Base - attr_accessible :comment, :url, :effected_at - validates :user_id, :presence => true validates :url, :presence => true, :url_format => true validates :comment, :length => { :maximum => 200 } diff --git a/app/models/event.rb b/app/models/event.rb index 9344957..01be156 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -1,6 +1,4 @@ class Event < ActiveRecord::Base - attr_accessible :address, :cover_url, :cover_original_url, :cover_original_author, :description, :end_at, :label, :name, :place, :start_at, :turnout, :url - validates :label, :presence => true, :uniqueness => true validates :name, :presence => true validates :turnout, :presence => true, :numericality => true diff --git a/app/models/favorite.rb b/app/models/favorite.rb index bdd9e03..a7818e9 100644 --- a/app/models/favorite.rb +++ b/app/models/favorite.rb @@ -1,6 +1,4 @@ class Favorite < ActiveRecord::Base - attr_accessible :effect_id, :user_id - validates :effect_id, :presence => true validates :user_id, :presence => true diff --git a/app/models/tag.rb b/app/models/tag.rb index 5f8c129..fa90f21 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -1,6 +1,4 @@ class Tag < ActiveRecord::Base - attr_accessible :name, :category - validates :name, :presence => true, :uniqueness => true has_many :taggings diff --git a/app/models/tagging.rb b/app/models/tagging.rb index 4cc7d77..20e7a96 100644 --- a/app/models/tagging.rb +++ b/app/models/tagging.rb @@ -1,6 +1,4 @@ class Tagging < ActiveRecord::Base - attr_accessible :tag_id, :effect_id, :user_id - validates :tag_id, :presence => true validates :effect_id, :presence => true validates :user_id, :presence => true diff --git a/app/models/user.rb b/app/models/user.rb index b0f73d1..2fdc1f7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- class User < ActiveRecord::Base - attr_accessible :profile - validates :name, :presence => true, :uniqueness => true, :format => { :with => /\A[A-Za-z0-9_]+\z/ }, :length => { :in => 2..50 } validates :icon_url, :presence => true validates :twitter_id, :presence => true From 366218959dbdb0aa083acb192c7980f483053302 Mon Sep 17 00:00:00 2001 From: asonas Date: Fri, 22 Dec 2017 18:56:19 +0900 Subject: [PATCH 14/18] Add Urlformatvalidator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UrlFormatValidatorがRailsから消えたぽいので追加しました。 --- app/validators/url_format_validator.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/validators/url_format_validator.rb diff --git a/app/validators/url_format_validator.rb b/app/validators/url_format_validator.rb new file mode 100644 index 0000000..8cb712a --- /dev/null +++ b/app/validators/url_format_validator.rb @@ -0,0 +1,7 @@ +class UrlFormatValidator < ActiveModel::EachValidator + def validate_each(record, attribute, value) + if value.present? && value !~ /\A#{URI::regexp(%w(http https))}\z/ + record.errors[attribute] << (options[:message] || I18n.t('validators.format')) + end + end +end From bb1fbae5a7520b2e05c0eaddacf739a30f1fc8db Mon Sep 17 00:00:00 2001 From: asonas Date: Wed, 27 Dec 2017 21:51:52 +0900 Subject: [PATCH 15/18] Update ruby --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index afb2a0b..d5de006 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -ruby "2.4.2" +ruby "2.5.0" gem 'rails', '4.2.10' diff --git a/Gemfile.lock b/Gemfile.lock index 6c51ce2..4568d33 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -271,7 +271,7 @@ DEPENDENCIES web-console (~> 2.0) RUBY VERSION - ruby 2.4.2p198 + ruby 2.5.0p0 BUNDLED WITH - 1.16.0 + 1.16.1 From c1627f659fcc22cfd242e2680a4ef0f087be380f Mon Sep 17 00:00:00 2001 From: asonas Date: Sat, 13 Jan 2018 15:36:10 +0900 Subject: [PATCH 16/18] hash syntax --- db/schema.rb | 141 ++++++++++++++++++++++++++------------------------- 1 file changed, 72 insertions(+), 69 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 6a970d0..cce9d71 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,104 +9,107 @@ # from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # -# It's strongly recommended to check this file into your version control system. - -ActiveRecord::Schema.define(:version => 20120605025802) do - - create_table "contributions", :force => true do |t| - t.integer "user_id", :null => false - t.integer "event_id", :null => false - t.boolean "attendee", :default => false - t.boolean "staff", :default => false - t.boolean "talker", :default => false - t.boolean "dorar", :default => false - t.boolean "watcher", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20120605025802) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "contributions", force: :cascade do |t| + t.integer "user_id", null: false + t.integer "event_id", null: false + t.boolean "attendee", default: false + t.boolean "staff", default: false + t.boolean "talker", default: false + t.boolean "dorar", default: false + t.boolean "watcher", default: false + t.datetime "created_at" + t.datetime "updated_at" end - add_index "contributions", ["event_id"], :name => "index_contributions_on_event_id" - add_index "contributions", ["user_id", "event_id"], :name => "index_contributions_on_user_id_and_event_id", :unique => true - add_index "contributions", ["user_id"], :name => "index_contributions_on_user_id" + add_index "contributions", ["event_id"], name: "index_contributions_on_event_id", using: :btree + add_index "contributions", ["user_id", "event_id"], name: "index_contributions_on_user_id_and_event_id", unique: true, using: :btree + add_index "contributions", ["user_id"], name: "index_contributions_on_user_id", using: :btree - create_table "effects", :force => true do |t| - t.integer "user_id", :null => false - t.string "url", :null => false + create_table "effects", force: :cascade do |t| + t.integer "user_id", null: false + t.string "url", null: false t.string "comment" - t.datetime "effected_at", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "effected_at", null: false + t.datetime "created_at" + t.datetime "updated_at" end - add_index "effects", ["user_id"], :name => "index_effects_on_user_id" + add_index "effects", ["user_id"], name: "index_effects_on_user_id", using: :btree - create_table "events", :force => true do |t| - t.string "label", :null => false - t.string "name", :null => false + create_table "events", force: :cascade do |t| + t.string "label", null: false + t.string "name", null: false t.string "description" t.string "url" - t.integer "turnout", :default => 0, :null => false + t.integer "turnout", default: 0, null: false t.string "place" t.string "address" - t.datetime "start_at", :null => false - t.datetime "end_at", :null => false + t.datetime "start_at", null: false + t.datetime "end_at", null: false t.string "cover_url" t.string "cover_original_url" t.string "cover_original_author" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" end - add_index "events", ["end_at"], :name => "index_events_on_end_at" - add_index "events", ["label"], :name => "index_events_on_label", :unique => true - add_index "events", ["start_at"], :name => "index_events_on_start_at" + add_index "events", ["end_at"], name: "index_events_on_end_at", using: :btree + add_index "events", ["label"], name: "index_events_on_label", unique: true, using: :btree + add_index "events", ["start_at"], name: "index_events_on_start_at", using: :btree - create_table "favorites", :force => true do |t| - t.integer "effect_id", :null => false - t.integer "user_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "favorites", force: :cascade do |t| + t.integer "effect_id", null: false + t.integer "user_id", null: false + t.datetime "created_at" + t.datetime "updated_at" end - add_index "favorites", ["effect_id", "user_id"], :name => "index_favorites_on_effect_id_and_user_id", :unique => true - add_index "favorites", ["effect_id"], :name => "index_favorites_on_effect_id" - add_index "favorites", ["user_id"], :name => "index_favorites_on_user_id" + add_index "favorites", ["effect_id", "user_id"], name: "index_favorites_on_effect_id_and_user_id", unique: true, using: :btree + add_index "favorites", ["effect_id"], name: "index_favorites_on_effect_id", using: :btree + add_index "favorites", ["user_id"], name: "index_favorites_on_user_id", using: :btree - create_table "taggings", :force => true do |t| - t.integer "tag_id", :null => false - t.integer "effect_id", :null => false - t.integer "user_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "taggings", force: :cascade do |t| + t.integer "tag_id", null: false + t.integer "effect_id", null: false + t.integer "user_id", null: false + t.datetime "created_at" + t.datetime "updated_at" end - add_index "taggings", ["effect_id"], :name => "index_taggings_on_effect_id" - add_index "taggings", ["tag_id", "effect_id"], :name => "index_taggings_on_tag_id_and_effect_id", :unique => true - add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" - add_index "taggings", ["user_id"], :name => "index_taggings_on_user_id" + add_index "taggings", ["effect_id"], name: "index_taggings_on_effect_id", using: :btree + add_index "taggings", ["tag_id", "effect_id"], name: "index_taggings_on_tag_id_and_effect_id", unique: true, using: :btree + add_index "taggings", ["tag_id"], name: "index_taggings_on_tag_id", using: :btree + add_index "taggings", ["user_id"], name: "index_taggings_on_user_id", using: :btree - create_table "tags", :force => true do |t| - t.string "name", :null => false + create_table "tags", force: :cascade do |t| + t.string "name", null: false t.string "category" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" end - add_index "tags", ["category"], :name => "index_tags_on_category" - add_index "tags", ["name"], :name => "index_tags_on_name", :unique => true + add_index "tags", ["category"], name: "index_tags_on_category", using: :btree + add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree - create_table "users", :force => true do |t| - t.string "name", :null => false - t.string "icon_url", :null => false + create_table "users", force: :cascade do |t| + t.string "name", null: false + t.string "icon_url", null: false t.string "profile" - t.string "twitter_id", :null => false - t.string "access_token", :null => false - t.string "access_secret", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.string "twitter_id", null: false + t.string "access_token", null: false + t.string "access_secret", null: false + t.datetime "created_at" + t.datetime "updated_at" end - add_index "users", ["name"], :name => "index_users_on_name", :unique => true - add_index "users", ["twitter_id"], :name => "index_users_on_twitter_id", :unique => true + add_index "users", ["name"], name: "index_users_on_name", unique: true, using: :btree + add_index "users", ["twitter_id"], name: "index_users_on_twitter_id", unique: true, using: :btree end From 416db587f88652614b68c97924ed2a4f14215daf Mon Sep 17 00:00:00 2001 From: asonas Date: Sat, 13 Jan 2018 15:36:27 +0900 Subject: [PATCH 17/18] Rewrite scope --- app/models/tag.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/tag.rb b/app/models/tag.rb index fa90f21..7fc25f7 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -4,7 +4,7 @@ class Tag < ActiveRecord::Base has_many :taggings has_many :effects, :through => :taggings - scope :event, where(:category => "event") + scope :event, -> { where(:category => "event") } def to_param self.name From da906aa8b1b67505ee366c0ece38444208e1f527 Mon Sep 17 00:00:00 2001 From: asonas Date: Sat, 13 Jan 2018 15:39:43 +0900 Subject: [PATCH 18/18] Remove unneeded line --- app/assets/javascripts/application.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index c9f7ac6..694a115 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -13,6 +13,5 @@ //= require jquery //= require jquery_ujs //= require underscore -//= require twitter/bootstrap //= require jquery.embedly.min //= require kceffect