From 9de81b05fa5da4dadb79fc7365587829d1bf1e30 Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Sun, 9 Apr 2017 15:33:35 +0300 Subject: [PATCH 01/11] update rubocop, rubycritic, brakeman, rspec/sass-rails --- Gemfile | 10 ++--- Gemfile.lock | 109 +++++++++++++++++++-------------------------------- 2 files changed, 46 insertions(+), 73 deletions(-) diff --git a/Gemfile b/Gemfile index acdc8fff2..3c5aef8f4 100644 --- a/Gemfile +++ b/Gemfile @@ -34,7 +34,7 @@ gem 'haml-rails', '0.9.0' # haml for views gem 'nokogiri', '1.7.1' # For XML parsing # style -gem 'sass-rails', '5.0.3' # sass style +gem 'sass-rails', '5.0.6' # sass style gem 'bootstrap-sass', '3.3.5.1' # bootstrap style # js @@ -110,7 +110,7 @@ group :development do gem 'guard', '2.12.9' # run tests automatically gem 'guard-rspec', '4.5.2' gem 'guard-rails', '0.7.1' # run EPP server automatically - gem 'rubocop', '0.32.1' + gem 'rubocop', '0.48.1' gem 'guard-rubocop', '1.2.0' # deploy @@ -119,7 +119,7 @@ end group :development, :test do # test stack - gem 'rspec-rails', '3.5.0' + gem 'rspec-rails', '3.5.2' gem 'capybara', '2.4.4' gem 'phantomjs-binaries', '1.9.2.4' gem 'poltergeist', '1.6.0' # We are using PhantomJS instead @@ -132,12 +132,12 @@ group :development, :test do # code review gem 'simplecov', '0.10.0', require: false - gem 'rubycritic', '1.4.0' + gem 'rubycritic', '3.2.0' gem 'bullet', '4.14.7' # for finding database optimizations gem 'bundler-audit', github: 'rubysec/bundler-audit', ref: 'f89ef7fae1090bbad825ea76812d56d72b417055' # for finding future vulnerable gems - gem 'brakeman', '3.0.5', require: false # for security audit' + gem 'brakeman', '3.6.1', require: false # for security audit' # tmp, otherwise conflics with breakman # gem 'html2haml', github: 'haml/html2haml', ref: '6984f50bdbbd6291535027726a5697f28778ee8d' gem 'html2haml', '2.1.0' diff --git a/Gemfile.lock b/Gemfile.lock index 991fc5d2d..a9879fc01 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -57,7 +57,6 @@ GEM remote: https://rubygems.org/ specs: SyslogLogger (2.0) - abstract_type (0.0.7) actionmailer (4.2.7.1) actionpack (= 4.2.7.1) actionview (= 4.2.7.1) @@ -95,9 +94,6 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - adamantium (0.2.0) - ice_nine (~> 0.11.0) - memoizable (~> 0.4.0) addressable (2.5.1) public_suffix (~> 2.0, >= 2.0.2) airbrake (6.0.0) @@ -108,8 +104,6 @@ GEM nokogiri arel (6.0.4) ast (2.3.0) - astrolabe (1.3.1) - parser (~> 2.2) autodoc (0.6.0) actionpack activesupport (>= 3.0.0) @@ -126,16 +120,7 @@ GEM bootstrap-sass (3.3.5.1) autoprefixer-rails (>= 5.0.0.1) sass (>= 3.3.0) - brakeman (3.0.5) - erubis (~> 2.6) - fastercsv (~> 1.5) - haml (>= 3.0, < 5.0) - highline (~> 1.6.20) - multi_json (~> 1.2) - ruby2ruby (~> 2.1.1) - ruby_parser (~> 3.7.0) - sass (~> 3.0) - terminal-table (~> 1.4) + brakeman (3.6.1) builder (3.2.3) bullet (4.14.7) activesupport (>= 3.0.0) @@ -149,6 +134,8 @@ GEM xpath (~> 2.0) chronic (0.10.2) cliver (0.3.2) + codeclimate-engine-rb (0.4.0) + virtus (~> 1.0) coderay (1.1.0) coercible (1.0.0) descendants_tracker (~> 0.0.1) @@ -159,9 +146,6 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concord (0.1.5) - adamantium (~> 0.2.0) - equalizer (~> 0.0.9) concurrent-ruby (1.0.5) countries (0.11.4) currencies (~> 0.4.2) @@ -185,7 +169,7 @@ GEM responders thread_safe (~> 0.1) warden (~> 1.2.3) - diff-lcs (1.2.5) + diff-lcs (1.3) digidoc_client (0.2.1) crack (>= 0.1.8) httpclient (>= 2.3.4) @@ -204,16 +188,18 @@ GEM factory_girl_rails (4.8.0) factory_girl (~> 4.8.0) railties (>= 3.0.0) - fastercsv (1.5.5) ffi (1.9.18) figaro (1.1.1) thor (~> 0.14) - flay (2.4.0) + flay (2.8.1) + erubis (~> 2.7.0) + path_expander (~> 1.0) ruby_parser (~> 3.0) sexp_processor (~> 4.0) - flog (4.2.1) + flog (4.6.1) + path_expander (~> 1.0) ruby_parser (~> 3.1, > 3.1.0) - sexp_processor (~> 4.4) + sexp_processor (~> 4.8) formatador (0.2.5) globalid (0.3.7) activesupport (>= 4.1.0) @@ -261,7 +247,6 @@ GEM hashie (3.5.5) hashie-forbidden_attributes (0.1.1) hashie (>= 3.0) - highline (1.6.21) hpricot (0.8.6) html2haml (2.1.0) erubis (~> 2.7.0) @@ -311,8 +296,6 @@ GEM lumberjack (1.0.11) mail (2.6.4) mime-types (>= 1.16, < 4) - memoizable (0.4.2) - thread_safe (~> 0.3, >= 0.3.1) method_source (0.8.2) mime-types (3.1) mime-types-data (~> 3.2015) @@ -344,8 +327,9 @@ GEM nprogress-rails (0.1.6.7) open4 (1.3.4) orm_adapter (0.5.0) - parser (2.2.3.0) - ast (>= 1.1, < 3.0) + parser (2.4.0.0) + ast (~> 2.2) + path_expander (1.0.1) pdfkit (0.6.2) pg (0.19.0) phantomjs (1.9.8.0) @@ -359,7 +343,6 @@ GEM polyamorous (1.3.1) activerecord (>= 3.0) powerpack (0.1.1) - procto (0.0.3) pry (0.10.1) coderay (~> 1.1.0) method_source (~> 0.8.1) @@ -419,10 +402,10 @@ GEM rb-inotify (0.9.8) ffi (>= 0.5.0) rdoc (4.3.0) - reek (1.6.5) - parser (~> 2.2.0.pre.7) - rainbow (>= 1.99, < 3.0) - unparser (~> 0.2.2) + reek (4.6.1) + codeclimate-engine-rb (~> 0.4.0) + parser (>= 2.3.1.2, < 2.5) + rainbow (~> 2.0) ref (2.0.0) request_store (1.1.0) responders (2.3.0) @@ -443,7 +426,7 @@ GEM rspec-mocks (3.5.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.5.0) - rspec-rails (3.5.0) + rspec-rails (3.5.2) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) @@ -452,33 +435,33 @@ GEM rspec-mocks (~> 3.5.0) rspec-support (~> 3.5.0) rspec-support (3.5.0) - rubocop (0.32.1) - astrolabe (~> 1.3) - parser (>= 2.2.2.5, < 3.0) + rubocop (0.48.1) + parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) - ruby-progressbar (~> 1.4) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) ruby-progressbar (1.8.1) - ruby2ruby (2.1.4) - ruby_parser (~> 3.1) - sexp_processor (~> 4.0) ruby_dep (1.5.0) - ruby_parser (3.7.3) + ruby_parser (3.8.4) sexp_processor (~> 4.1) - rubycritic (1.4.0) - flay (= 2.4.0) - flog (= 4.2.1) - parser (>= 2.2.0, < 3.0) - reek (= 1.6.5) + rubycritic (3.2.0) + flay (~> 2.8) + flog (~> 4.4) + launchy (= 2.4.3) + parser (= 2.4.0) + rainbow (~> 2.1) + reek (~> 4.4) + ruby_parser (~> 3.8) virtus (~> 1.0) safe_yaml (1.0.4) sass (3.4.23) - sass-rails (5.0.3) - railties (>= 4.0.0, < 5.0) + sass-rails (5.0.6) + railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) - tilt (~> 1.1) + tilt (>= 1.1, < 3) savon (2.11.1) akami (~> 1.2) builder (>= 2.1.2) @@ -519,8 +502,6 @@ GEM sprockets (>= 3.0.0) sys-uname (0.9.0) ffi (>= 1.0.0) - terminal-table (1.7.3) - unicode-display_width (~> 1.1.1) therubyracer (0.12.2) libv8 (~> 3.16.14.0) ref @@ -537,19 +518,11 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.7.2) - unicode-display_width (1.1.3) + unicode-display_width (1.2.0) unicorn (5.3.0) kgio (~> 2.6) raindrops (~> 0.7) uniform_notifier (1.9.0) - unparser (0.2.4) - abstract_type (~> 0.0.7) - adamantium (~> 0.2.0) - concord (~> 0.1.5) - diff-lcs (~> 1.2.5) - equalizer (~> 0.0.9) - parser (~> 2.2.2) - procto (~> 0.0.2) uuidtools (2.1.5) validates_email_format_of (1.6.3) i18n @@ -585,7 +558,7 @@ DEPENDENCIES autodoc bootstrap-datepicker-rails (= 1.3.1.1) bootstrap-sass (= 3.3.5.1) - brakeman (= 3.0.5) + brakeman (= 3.6.1) bullet (= 4.14.7) bundler-audit! cancancan (= 1.11.0) @@ -641,10 +614,10 @@ DEPENDENCIES rails-settings-cached (= 0.4.1) ransack (= 1.5.1) rest-client - rspec-rails (= 3.5.0) - rubocop (= 0.32.1) - rubycritic (= 1.4.0) - sass-rails (= 5.0.3) + rspec-rails (= 3.5.2) + rubocop (= 0.48.1) + rubycritic (= 3.2.0) + sass-rails (= 5.0.6) sdoc (= 0.4.1) select2-rails (= 3.5.9.3) selectize-rails (= 0.12.1) @@ -662,4 +635,4 @@ DEPENDENCIES whenever (= 0.9.4) BUNDLED WITH - 1.13.6 + 1.14.6 From 3d16656e177455820f1faa6fc9da2d5acf704e67 Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Sun, 9 Apr 2017 15:53:48 +0300 Subject: [PATCH 02/11] update money-rails, countries and digidoc_client --- Gemfile | 6 +++--- Gemfile.lock | 34 +++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/Gemfile b/Gemfile index 3c5aef8f4..f4dbae4c5 100644 --- a/Gemfile +++ b/Gemfile @@ -66,7 +66,7 @@ gem 'jbuilder', '2.2.16' # json api # registry specfic gem 'simpleidn', '0.0.7' # For punycode gem 'isikukood' # for EE-id validation -gem 'money-rails', '1.4.1' +gem 'money-rails', '1.8.0' # deploy gem 'whenever', '0.9.4', require: false @@ -75,13 +75,13 @@ gem 'data_migrate', ref: '35d22b09ff37a4e9d61ab326ad5d8eb0edf1fc81' # country listing -gem 'countries', '0.11.4' +gem 'countries', '2.0.8' # cloning activerecord objects gem 'deep_cloneable', '2.1.1' # id + mid login -gem 'digidoc_client', '0.2.1' +gem 'digidoc_client', '0.3.0' gem 'epp', '1.5.0', github: 'internetee/epp' gem 'epp-xml', '1.1.0', github: 'internetee/epp-xml' diff --git a/Gemfile.lock b/Gemfile.lock index a9879fc01..5e761d7f7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -147,12 +147,13 @@ GEM execjs coffee-script-source (1.12.2) concurrent-ruby (1.0.5) - countries (0.11.4) - currencies (~> 0.4.2) + countries (2.0.8) i18n_data (~> 0.7.0) + money (~> 6.7) + sixarm_ruby_unaccent (~> 1.1) + unicode_utils (~> 1.4) crack (0.4.3) safe_yaml (~> 1.0.0) - currencies (0.4.2) daemons (1.2.4) daemons-rails (1.2.1) daemons @@ -170,7 +171,7 @@ GEM thread_safe (~> 0.1) warden (~> 1.2.3) diff-lcs (1.3) - digidoc_client (0.2.1) + digidoc_client (0.3.0) crack (>= 0.1.8) httpclient (>= 2.3.4) mime-types (>= 1.16) @@ -260,7 +261,7 @@ GEM httpi (2.4.2) rack socksify - i18n (0.7.0) + i18n (0.8.1) i18n_data (0.7.0) ice_nine (0.11.2) isikukood (0.1.2) @@ -305,14 +306,15 @@ GEM rake mini_portile2 (2.1.0) minitest (5.10.1) - monetize (1.1.0) - money (~> 6.5.0) - money (6.5.1) - i18n (>= 0.6.4, <= 0.7.0) - money-rails (1.4.1) + monetize (1.6.0) + money (~> 6.8) + money (6.8.3) + i18n (>= 0.6.4, < 0.9) + sixarm_ruby_unaccent (>= 1.1.1, < 2) + money-rails (1.8.0) activesupport (>= 3.0) - monetize (~> 1.1.0) - money (~> 6.5.0) + monetize (~> 1.6.0) + money (~> 6.8.1) railties (>= 3.0) multi_json (1.12.1) multi_xml (0.6.0) @@ -488,6 +490,7 @@ GEM rack (~> 1.5) rack-protection (~> 1.4) tilt (>= 1.3, < 3) + sixarm_ruby_unaccent (1.1.1) slop (3.6.0) socksify (1.7.1) spring (1.3.6) @@ -519,6 +522,7 @@ GEM unf_ext unf_ext (0.0.7.2) unicode-display_width (1.2.0) + unicode_utils (1.4.0) unicorn (5.3.0) kgio (~> 2.6) raindrops (~> 0.7) @@ -565,13 +569,13 @@ DEPENDENCIES capybara (= 2.4.4) coderay (= 1.1.0) coffee-rails (= 4.1.0) - countries (= 0.11.4) + countries (= 2.0.8) daemons-rails (= 1.2.1) data_migrate! database_cleaner deep_cloneable (= 2.1.1) devise (= 3.5.4) - digidoc_client (= 0.2.1) + digidoc_client (= 0.3.0) epp (= 1.5.0)! epp-xml (= 1.1.0)! fabrication (= 2.13.2) @@ -596,7 +600,7 @@ DEPENDENCIES launchy (= 2.4.3) liquid (= 3.0.6) mina (= 0.3.1) - money-rails (= 1.4.1) + money-rails (= 1.8.0) nokogiri (= 1.7.1) nprogress-rails (= 0.1.6.7) paper_trail! From 1a3a424c537457468ab8e0809cba3160b93b9f63 Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Sun, 9 Apr 2017 16:16:06 +0300 Subject: [PATCH 03/11] try digidoc master --- Gemfile | 6 +++++- Gemfile.lock | 20 +++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index f4dbae4c5..3d251e351 100644 --- a/Gemfile +++ b/Gemfile @@ -81,7 +81,11 @@ gem 'countries', '2.0.8' gem 'deep_cloneable', '2.1.1' # id + mid login -gem 'digidoc_client', '0.3.0' +#gem 'digidoc_client', '0.3.0' +gem 'digidoc_client', + github: 'tarmotalu/digidoc_client', + ref: '1645e83a5a548addce383f75703b0275c5310c32' + gem 'epp', '1.5.0', github: 'internetee/epp' gem 'epp-xml', '1.1.0', github: 'internetee/epp-xml' diff --git a/Gemfile.lock b/Gemfile.lock index 5e761d7f7..d31e03a11 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -53,6 +53,18 @@ GIT bundler (~> 1.2) thor (~> 0.18) +GIT + remote: https://github.com/tarmotalu/digidoc_client.git + revision: 1645e83a5a548addce383f75703b0275c5310c32 + ref: 1645e83a5a548addce383f75703b0275c5310c32 + specs: + digidoc_client (0.3.0) + crack (>= 0.1.8) + httpclient (>= 2.3.4) + mime-types (>= 1.16) + nokogiri (>= 1.4.0) + savon (>= 2.4.0) + GEM remote: https://rubygems.org/ specs: @@ -171,12 +183,6 @@ GEM thread_safe (~> 0.1) warden (~> 1.2.3) diff-lcs (1.3) - digidoc_client (0.3.0) - crack (>= 0.1.8) - httpclient (>= 2.3.4) - mime-types (>= 1.16) - nokogiri (>= 1.4.0) - savon (>= 2.4.0) docile (1.1.5) domain_name (0.5.20170404) unf (>= 0.0.5, < 1.0.0) @@ -575,7 +581,7 @@ DEPENDENCIES database_cleaner deep_cloneable (= 2.1.1) devise (= 3.5.4) - digidoc_client (= 0.3.0) + digidoc_client! epp (= 1.5.0)! epp-xml (= 1.1.0)! fabrication (= 2.13.2) From 12d80ce2cc1197fbec577b9614fee7f5be9e2213 Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Sun, 9 Apr 2017 16:34:50 +0300 Subject: [PATCH 04/11] follow digidoc git master, disable digidoc initializer --- Gemfile | 2 +- config/initializers/digidoc.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 3d251e351..28549ba7c 100644 --- a/Gemfile +++ b/Gemfile @@ -84,7 +84,7 @@ gem 'deep_cloneable', '2.1.1' #gem 'digidoc_client', '0.3.0' gem 'digidoc_client', github: 'tarmotalu/digidoc_client', - ref: '1645e83a5a548addce383f75703b0275c5310c32' + branch: 'master' gem 'epp', '1.5.0', github: 'internetee/epp' diff --git a/config/initializers/digidoc.rb b/config/initializers/digidoc.rb index 2b103f750..0090c420d 100644 --- a/config/initializers/digidoc.rb +++ b/config/initializers/digidoc.rb @@ -1 +1 @@ -Digidoc::Client.logger = Rails.application.config.logger +#Digidoc::Client.logger = Rails.application.config.logger From 1a315363df41fc9800e49b22ff5d8bcd6b5a4a29 Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Sun, 9 Apr 2017 16:45:06 +0300 Subject: [PATCH 05/11] use new Cops syntax, ignore example files --- .rubocop.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index c9689567c..da8ac641f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,10 +1,12 @@ AllCops: - RunRailsCops: true - - Exclude: + Rails: + Enabled: True + Exclude: - 'Guardfile' # stuff generated by AR and rails - 'config/deploy-example.rb' + - 'config/environments/development-example.rb' + - 'config/environments/staging-example.rb' - 'db/schema.rb' - 'db/schema-read-only.rb' - 'db/whois_schema.rb' From c92185ccb581cd54f78707969ae5e45ca5b9e6d0 Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Sun, 9 Apr 2017 16:59:46 +0300 Subject: [PATCH 06/11] move back to 1.x countries --- Gemfile | 3 ++- Gemfile.lock | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 28549ba7c..7a02ebb7a 100644 --- a/Gemfile +++ b/Gemfile @@ -75,7 +75,8 @@ gem 'data_migrate', ref: '35d22b09ff37a4e9d61ab326ad5d8eb0edf1fc81' # country listing -gem 'countries', '2.0.8' +#gem 'countries', '2.0.8' +gem 'countries', '1.2.5' # cloning activerecord objects gem 'deep_cloneable', '2.1.1' diff --git a/Gemfile.lock b/Gemfile.lock index d31e03a11..f0899e38b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -56,7 +56,7 @@ GIT GIT remote: https://github.com/tarmotalu/digidoc_client.git revision: 1645e83a5a548addce383f75703b0275c5310c32 - ref: 1645e83a5a548addce383f75703b0275c5310c32 + branch: master specs: digidoc_client (0.3.0) crack (>= 0.1.8) @@ -159,13 +159,12 @@ GEM execjs coffee-script-source (1.12.2) concurrent-ruby (1.0.5) - countries (2.0.8) + countries (1.2.5) + currencies (~> 0.4.2) i18n_data (~> 0.7.0) - money (~> 6.7) - sixarm_ruby_unaccent (~> 1.1) - unicode_utils (~> 1.4) crack (0.4.3) safe_yaml (~> 1.0.0) + currencies (0.4.2) daemons (1.2.4) daemons-rails (1.2.1) daemons @@ -528,7 +527,6 @@ GEM unf_ext unf_ext (0.0.7.2) unicode-display_width (1.2.0) - unicode_utils (1.4.0) unicorn (5.3.0) kgio (~> 2.6) raindrops (~> 0.7) @@ -575,7 +573,7 @@ DEPENDENCIES capybara (= 2.4.4) coderay (= 1.1.0) coffee-rails (= 4.1.0) - countries (= 2.0.8) + countries (= 1.2.5) daemons-rails (= 1.2.1) data_migrate! database_cleaner From 1444590b1b34c847677c4bc768f6ee60f4686569 Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Sun, 9 Apr 2017 17:12:38 +0300 Subject: [PATCH 07/11] require countries/global --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 7a02ebb7a..bbc463b1a 100644 --- a/Gemfile +++ b/Gemfile @@ -76,7 +76,7 @@ gem 'data_migrate', # country listing #gem 'countries', '2.0.8' -gem 'countries', '1.2.5' +gem 'countries', '1.2.5', :require => 'countries/global' # cloning activerecord objects gem 'deep_cloneable', '2.1.1' From e5d7c6c740bd564365b98b2dd746742c33683ac1 Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Sun, 9 Apr 2017 17:37:28 +0300 Subject: [PATCH 08/11] fix sorted_country --- .rubocop.yml | 2 -- lib/sorted_country.rb | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index da8ac641f..0857a9120 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,4 @@ AllCops: - Rails: - Enabled: True Exclude: - 'Guardfile' # stuff generated by AR and rails diff --git a/lib/sorted_country.rb b/lib/sorted_country.rb index 1fc514d3f..e831c007b 100644 --- a/lib/sorted_country.rb +++ b/lib/sorted_country.rb @@ -32,12 +32,12 @@ class SortedCountry end def all_sorted - @all_sorted ||= Country.all.sort_by { |name, _code| name.first } + @all_sorted ||= Country.all.sort_by(&:name) end def all_sorted_truncated - @all_sorted_truncated ||= - all_sorted.map { |name, code| [truncate(name, length: 26), code] } + @all_sorted_truncated ||= + all_sorted.map { |country| [truncate(name, length: 26), country.alpha2] } end end end From 20b521576904072393bac046f8d387c0d84181c9 Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Sun, 9 Apr 2017 17:52:37 +0300 Subject: [PATCH 09/11] use latest countries --- Gemfile | 3 +-- Gemfile.lock | 10 ++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index bbc463b1a..5f973598e 100644 --- a/Gemfile +++ b/Gemfile @@ -75,8 +75,7 @@ gem 'data_migrate', ref: '35d22b09ff37a4e9d61ab326ad5d8eb0edf1fc81' # country listing -#gem 'countries', '2.0.8' -gem 'countries', '1.2.5', :require => 'countries/global' +gem 'countries', :require => 'countries/global' # cloning activerecord objects gem 'deep_cloneable', '2.1.1' diff --git a/Gemfile.lock b/Gemfile.lock index f0899e38b..27375b23a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -159,12 +159,13 @@ GEM execjs coffee-script-source (1.12.2) concurrent-ruby (1.0.5) - countries (1.2.5) - currencies (~> 0.4.2) + countries (2.0.8) i18n_data (~> 0.7.0) + money (~> 6.7) + sixarm_ruby_unaccent (~> 1.1) + unicode_utils (~> 1.4) crack (0.4.3) safe_yaml (~> 1.0.0) - currencies (0.4.2) daemons (1.2.4) daemons-rails (1.2.1) daemons @@ -527,6 +528,7 @@ GEM unf_ext unf_ext (0.0.7.2) unicode-display_width (1.2.0) + unicode_utils (1.4.0) unicorn (5.3.0) kgio (~> 2.6) raindrops (~> 0.7) @@ -573,7 +575,7 @@ DEPENDENCIES capybara (= 2.4.4) coderay (= 1.1.0) coffee-rails (= 4.1.0) - countries (= 1.2.5) + countries daemons-rails (= 1.2.1) data_migrate! database_cleaner From 353d4b74f775c9b2a279aaff59f2b3682953407f Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Sun, 9 Apr 2017 18:09:42 +0300 Subject: [PATCH 10/11] add .reek config file --- .reek | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .reek diff --git a/.reek b/.reek new file mode 100644 index 000000000..d94291666 --- /dev/null +++ b/.reek @@ -0,0 +1,3 @@ +exclude_paths: + - db/migrate/ + - db/data/ From bc737f064aa614125fa321f461ee74a95bc14682 Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Sun, 9 Apr 2017 18:59:21 +0300 Subject: [PATCH 11/11] use latest money-rails --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 5f973598e..d570ed721 100644 --- a/Gemfile +++ b/Gemfile @@ -66,7 +66,7 @@ gem 'jbuilder', '2.2.16' # json api # registry specfic gem 'simpleidn', '0.0.7' # For punycode gem 'isikukood' # for EE-id validation -gem 'money-rails', '1.8.0' +gem 'money-rails' # deploy gem 'whenever', '0.9.4', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 27375b23a..f49dab70d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -606,7 +606,7 @@ DEPENDENCIES launchy (= 2.4.3) liquid (= 3.0.6) mina (= 0.3.1) - money-rails (= 1.8.0) + money-rails nokogiri (= 1.7.1) nprogress-rails (= 0.1.6.7) paper_trail!