diff --git a/.rubocop.yml b/.rubocop.yml index b5206fde86b6d033b2a50135945a1ce0e7e7ec6f..576aca0f5527d5f3287596ba12b0f21a489fd179 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,7 +7,3 @@ BlockLength: - config/routes.rb Rails/HttpPositionalArguments: Enabled: false -# https://github.com/bbatsov/rubocop/issues/4189 -# TODO remove once rubocopy has changed beyond 0.48.1 -Lint/AmbiguousBlockAssociation: - Enabled: false diff --git a/Gemfile.lock b/Gemfile.lock index e28cc485d79b169ab9d4e911c9f55824feedbf3a..7bfb8382d0ce2586f1916515750caa3eb8174562 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/activeadmin/activeadmin.git - revision: 8f7f58016802cd5a7f663fbc80b90b884252f939 + revision: d941aaa88c6e9011f7e9d1c7d85b2cd871160f0f specs: activeadmin (1.0.0) arbre (>= 1.1.1) @@ -72,8 +72,8 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - acts-as-taggable-on (4.0.0) - activerecord (>= 4.0) + acts-as-taggable-on (5.0.0) + activerecord (>= 4.2.8) addressable (2.5.1) public_suffix (~> 2.0, >= 2.0.2) arbre (1.1.1) @@ -92,9 +92,9 @@ GEM thor (~> 0.18) byebug (9.0.6) coderay (1.1.1) - coffee-rails (4.2.1) + coffee-rails (4.2.2) coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.2.x) + railties (>= 4.0.0) coffee-script (2.4.1) coffee-script-source execjs @@ -268,6 +268,7 @@ GEM paper_trail (7.0.2) activerecord (>= 4.0, < 5.2) request_store (~> 1.1) + parallel (1.11.2) parser (2.4.0.0) ast (~> 2.2) piwik_analytics (1.0.2) @@ -338,7 +339,8 @@ GEM responders (2.4.0) actionpack (>= 4.2.0, < 5.3) railties (>= 4.2.0, < 5.3) - rubocop (0.48.1) + rubocop (0.49.0) + parallel (~> 1.10) parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) @@ -389,7 +391,7 @@ GEM thor (0.19.4) thread_safe (0.3.6) tilt (2.0.7) - tinymce-rails (4.6.1) + tinymce-rails (4.6.2) railties (>= 3.1.1) tinymce-rails-langs (4.20160310) tinymce-rails (~> 4.1, >= 4.1.10) diff --git a/app/models/admin_user.rb b/app/models/admin_user.rb index a7a554e0041250eb84cef2f4b2415422db3bbcde..a78df7d16934f13001a1750afcdbed982f1f44b1 100644 --- a/app/models/admin_user.rb +++ b/app/models/admin_user.rb @@ -1,5 +1,5 @@ # The new agenda moderators, from active_admin -class AdminUser < ActiveRecord::Base +class AdminUser < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 0000000000000000000000000000000000000000..23c70da48b8a6b964e2fba8c2d75ae78da6dad40 --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,4 @@ +# Base domain class +class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true +end diff --git a/app/models/city.rb b/app/models/city.rb index 068451f0395c2686d625b4364cf121a2c9011f60..9bf0cd0c4e546cb0dadf95ae3c0240f321cd035b 100644 --- a/app/models/city.rb +++ b/app/models/city.rb @@ -2,7 +2,7 @@ # # It is mainly used to manage coordinates # -class City < ActiveRecord::Base +class City < ApplicationRecord has_many :events, foreign_key: :city, primary_key: :name has_many :orgas, foreign_key: :city, primary_key: :name end diff --git a/app/models/event.rb b/app/models/event.rb index 11d93bbe95e41e6f8d5631d02e2126aa8390e17a..5d0ee2059a5ca453a8153e017a3c846eab771d24 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -1,7 +1,7 @@ require 'schedule' # This is the central ADL class, where are managed all events -class Event < ActiveRecord::Base +class Event < ApplicationRecord extend SimpleCalendar include Schedule acts_as_taggable diff --git a/app/models/kind.rb b/app/models/kind.rb index 3958ef5907a7eacea32eddef284d2dedd4c49dfb..79a7d5753d9a803ec7bfe9a11f56c3422629de79 100644 --- a/app/models/kind.rb +++ b/app/models/kind.rb @@ -1,4 +1,4 @@ # Gives the possibility to organise organisations! :) -class Kind < ActiveRecord::Base +class Kind < ApplicationRecord has_many :orgas end diff --git a/app/models/note.rb b/app/models/note.rb index f91a38b953a33ea1afd069c89509fc2efef09737..efb07df76e0185f6c6ef1cca2eb81606f6b5130d 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -1,5 +1,5 @@ # Manages data related to events' moderation -class Note < ActiveRecord::Base +class Note < ApplicationRecord belongs_to :event belongs_to :author, class_name: User diff --git a/app/models/orga.rb b/app/models/orga.rb index d4893a05855383620ba3915dd30da146bac0dd1d..bb0176b14512449981fe01e369fb37bb2e41a739 100644 --- a/app/models/orga.rb +++ b/app/models/orga.rb @@ -1,5 +1,5 @@ # Organisations related to this agenda -class Orga < ActiveRecord::Base +class Orga < ApplicationRecord acts_as_taggable strip_attributes has_paper_trail ignore: %i[last_updated secret submitter decision_time diff --git a/app/models/region.rb b/app/models/region.rb index b5a87c52068d2748f9cdd6d01b284369dd0619dc..ef6fa540eac4d275878dcd2665705863013a7a2b 100644 --- a/app/models/region.rb +++ b/app/models/region.rb @@ -1,5 +1,5 @@ # This is mostly to group events around a region -class Region < ActiveRecord::Base +class Region < ApplicationRecord belongs_to :region has_many :regions diff --git a/app/models/user.rb b/app/models/user.rb index 5895cf8a711b50fb39ee5bc2bc084fa0bf570cee..39cbcf29c32920fee7e62023869ffe9ef410a142 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,7 +2,7 @@ require 'digest/md5' # Moderators, but using a failed pwd mechanism # TODO, migrate to full active_admin -class User < ActiveRecord::Base +class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, authentication_keys: [:login]