diff --git a/app/models/admin_notification.rb b/app/models/admin_notification.rb index 6fc3e83e3..5e86f3d28 100644 --- a/app/models/admin_notification.rb +++ b/app/models/admin_notification.rb @@ -1,4 +1,4 @@ -class AdminNotification < ActiveRecord::Base +class AdminNotification < ApplicationRecord include Notifiable translates :title, touch: true diff --git a/app/models/budget/phase.rb b/app/models/budget/phase.rb index 2c50c10e8..5912a1453 100644 --- a/app/models/budget/phase.rb +++ b/app/models/budget/phase.rb @@ -1,5 +1,5 @@ class Budget - class Phase < ActiveRecord::Base + class Phase < ApplicationRecord PHASE_KINDS = %w(drafting informing accepting reviewing selecting valuating publishing_prices balloting reviewing_ballots finished).freeze PUBLISHED_PRICES_PHASES = %w(publishing_prices balloting reviewing_ballots finished).freeze diff --git a/app/models/budget/valuator_group_assignment.rb b/app/models/budget/valuator_group_assignment.rb index 88a04ae1a..3aa93cb14 100644 --- a/app/models/budget/valuator_group_assignment.rb +++ b/app/models/budget/valuator_group_assignment.rb @@ -1,5 +1,5 @@ class Budget - class ValuatorGroupAssignment < ActiveRecord::Base + class ValuatorGroupAssignment < ApplicationRecord belongs_to :valuator_group, counter_cache: :budget_investments_count belongs_to :investment, counter_cache: true end diff --git a/app/models/community.rb b/app/models/community.rb index c9dd0ddfb..b41dd45fc 100644 --- a/app/models/community.rb +++ b/app/models/community.rb @@ -1,4 +1,4 @@ -class Community < ActiveRecord::Base +class Community < ApplicationRecord has_one :proposal has_one :investment, class_name: Budget::Investment has_many :topics diff --git a/app/models/document.rb b/app/models/document.rb index e8524bc72..e1dd94ceb 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -1,4 +1,4 @@ -class Document < ActiveRecord::Base +class Document < ApplicationRecord include DocumentsHelper include DocumentablesHelper has_attached_file :attachment, url: "/system/:class/:prefix/:style/:hash.:extension", diff --git a/app/models/follow.rb b/app/models/follow.rb index 51628f7d4..8062ffecc 100644 --- a/app/models/follow.rb +++ b/app/models/follow.rb @@ -1,4 +1,4 @@ -class Follow < ActiveRecord::Base +class Follow < ApplicationRecord belongs_to :user belongs_to :followable, polymorphic: true diff --git a/app/models/image.rb b/app/models/image.rb index a782d1916..ce8e750ef 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -1,4 +1,4 @@ -class Image < ActiveRecord::Base +class Image < ApplicationRecord include ImagesHelper include ImageablesHelper diff --git a/app/models/legislation/proposal.rb b/app/models/legislation/proposal.rb index 0e1a39c90..16ab2d7dd 100644 --- a/app/models/legislation/proposal.rb +++ b/app/models/legislation/proposal.rb @@ -1,4 +1,4 @@ -class Legislation::Proposal < ActiveRecord::Base +class Legislation::Proposal < ApplicationRecord include ActsAsParanoidAliases include Flaggable include Taggable diff --git a/app/models/local_census_record.rb b/app/models/local_census_record.rb index 1c2c42d44..d275ec130 100644 --- a/app/models/local_census_record.rb +++ b/app/models/local_census_record.rb @@ -1,4 +1,4 @@ -class LocalCensusRecord < ActiveRecord::Base +class LocalCensusRecord < ApplicationRecord validates :document_number, presence: true validates :document_type, presence: true validates :date_of_birth, presence: true diff --git a/app/models/map_location.rb b/app/models/map_location.rb index 892ba8f20..d69c97ea3 100644 --- a/app/models/map_location.rb +++ b/app/models/map_location.rb @@ -1,4 +1,4 @@ -class MapLocation < ActiveRecord::Base +class MapLocation < ApplicationRecord belongs_to :proposal, touch: true belongs_to :investment, class_name: Budget::Investment, touch: true diff --git a/app/models/newsletter.rb b/app/models/newsletter.rb index 35ed57b91..bac4d8ef7 100644 --- a/app/models/newsletter.rb +++ b/app/models/newsletter.rb @@ -1,4 +1,4 @@ -class Newsletter < ActiveRecord::Base +class Newsletter < ApplicationRecord has_many :activities, as: :actionable validates :subject, presence: true diff --git a/app/models/poll/question/answer.rb b/app/models/poll/question/answer.rb index 2efa2b824..f3eb0c97e 100644 --- a/app/models/poll/question/answer.rb +++ b/app/models/poll/question/answer.rb @@ -1,4 +1,4 @@ -class Poll::Question::Answer < ActiveRecord::Base +class Poll::Question::Answer < ApplicationRecord include Galleryable include Documentable diff --git a/app/models/poll/question/answer/video.rb b/app/models/poll/question/answer/video.rb index 4804f5188..f7b9e9676 100644 --- a/app/models/poll/question/answer/video.rb +++ b/app/models/poll/question/answer/video.rb @@ -1,4 +1,4 @@ -class Poll::Question::Answer::Video < ActiveRecord::Base +class Poll::Question::Answer::Video < ApplicationRecord belongs_to :answer, class_name: "Poll::Question::Answer", foreign_key: "answer_id" VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/ diff --git a/app/models/poll/shift.rb b/app/models/poll/shift.rb index dd5c1db32..828fba66e 100644 --- a/app/models/poll/shift.rb +++ b/app/models/poll/shift.rb @@ -1,5 +1,5 @@ class Poll - class Shift < ActiveRecord::Base + class Shift < ApplicationRecord belongs_to :booth belongs_to :officer diff --git a/app/models/related_content.rb b/app/models/related_content.rb index f9facb47a..4a74ba3c7 100644 --- a/app/models/related_content.rb +++ b/app/models/related_content.rb @@ -1,4 +1,4 @@ -class RelatedContent < ActiveRecord::Base +class RelatedContent < ApplicationRecord RELATED_CONTENT_SCORE_THRESHOLD = Setting["related_content_score_threshold"].to_f RELATIONABLE_MODELS = %w{proposals debates budgets investments}.freeze diff --git a/app/models/related_content_score.rb b/app/models/related_content_score.rb index da37fc07d..3d7684545 100644 --- a/app/models/related_content_score.rb +++ b/app/models/related_content_score.rb @@ -1,4 +1,4 @@ -class RelatedContentScore < ActiveRecord::Base +class RelatedContentScore < ApplicationRecord SCORES = { POSITIVE: 1, NEGATIVE: -1 diff --git a/app/models/topic.rb b/app/models/topic.rb index e9e463aa5..8130c03da 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -1,4 +1,4 @@ -class Topic < ActiveRecord::Base +class Topic < ApplicationRecord acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases include Notifiable diff --git a/app/models/valuator_group.rb b/app/models/valuator_group.rb index 26738b542..9e8d388b5 100644 --- a/app/models/valuator_group.rb +++ b/app/models/valuator_group.rb @@ -1,4 +1,4 @@ -class ValuatorGroup < ActiveRecord::Base +class ValuatorGroup < ApplicationRecord has_many :valuators has_many :valuator_group_assignments, dependent: :destroy, class_name: "Budget::ValuatorGroupAssignment" has_many :investments, through: :valuator_group_assignments, class_name: "Budget::Investment"