Replace all occurrences of ActiveRecord::Base with ApplicationRecord
This commit is contained in:
committed by
Julian Herrero
parent
7ab602175a
commit
01c1ac2b10
@@ -1,4 +1,4 @@
|
|||||||
class AdminNotification < ActiveRecord::Base
|
class AdminNotification < ApplicationRecord
|
||||||
include Notifiable
|
include Notifiable
|
||||||
|
|
||||||
translates :title, touch: true
|
translates :title, touch: true
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Budget
|
class Budget
|
||||||
class Phase < ActiveRecord::Base
|
class Phase < ApplicationRecord
|
||||||
PHASE_KINDS = %w(drafting informing accepting reviewing selecting valuating publishing_prices balloting
|
PHASE_KINDS = %w(drafting informing accepting reviewing selecting valuating publishing_prices balloting
|
||||||
reviewing_ballots finished).freeze
|
reviewing_ballots finished).freeze
|
||||||
PUBLISHED_PRICES_PHASES = %w(publishing_prices balloting reviewing_ballots finished).freeze
|
PUBLISHED_PRICES_PHASES = %w(publishing_prices balloting reviewing_ballots finished).freeze
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Budget
|
class Budget
|
||||||
class ValuatorGroupAssignment < ActiveRecord::Base
|
class ValuatorGroupAssignment < ApplicationRecord
|
||||||
belongs_to :valuator_group, counter_cache: :budget_investments_count
|
belongs_to :valuator_group, counter_cache: :budget_investments_count
|
||||||
belongs_to :investment, counter_cache: true
|
belongs_to :investment, counter_cache: true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Community < ActiveRecord::Base
|
class Community < ApplicationRecord
|
||||||
has_one :proposal
|
has_one :proposal
|
||||||
has_one :investment, class_name: Budget::Investment
|
has_one :investment, class_name: Budget::Investment
|
||||||
has_many :topics
|
has_many :topics
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Document < ActiveRecord::Base
|
class Document < ApplicationRecord
|
||||||
include DocumentsHelper
|
include DocumentsHelper
|
||||||
include DocumentablesHelper
|
include DocumentablesHelper
|
||||||
has_attached_file :attachment, url: "/system/:class/:prefix/:style/:hash.:extension",
|
has_attached_file :attachment, url: "/system/:class/:prefix/:style/:hash.:extension",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Follow < ActiveRecord::Base
|
class Follow < ApplicationRecord
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :followable, polymorphic: true
|
belongs_to :followable, polymorphic: true
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Image < ActiveRecord::Base
|
class Image < ApplicationRecord
|
||||||
include ImagesHelper
|
include ImagesHelper
|
||||||
include ImageablesHelper
|
include ImageablesHelper
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Legislation::Proposal < ActiveRecord::Base
|
class Legislation::Proposal < ApplicationRecord
|
||||||
include ActsAsParanoidAliases
|
include ActsAsParanoidAliases
|
||||||
include Flaggable
|
include Flaggable
|
||||||
include Taggable
|
include Taggable
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class LocalCensusRecord < ActiveRecord::Base
|
class LocalCensusRecord < ApplicationRecord
|
||||||
validates :document_number, presence: true
|
validates :document_number, presence: true
|
||||||
validates :document_type, presence: true
|
validates :document_type, presence: true
|
||||||
validates :date_of_birth, presence: true
|
validates :date_of_birth, presence: true
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class MapLocation < ActiveRecord::Base
|
class MapLocation < ApplicationRecord
|
||||||
|
|
||||||
belongs_to :proposal, touch: true
|
belongs_to :proposal, touch: true
|
||||||
belongs_to :investment, class_name: Budget::Investment, touch: true
|
belongs_to :investment, class_name: Budget::Investment, touch: true
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Newsletter < ActiveRecord::Base
|
class Newsletter < ApplicationRecord
|
||||||
has_many :activities, as: :actionable
|
has_many :activities, as: :actionable
|
||||||
|
|
||||||
validates :subject, presence: true
|
validates :subject, presence: true
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Poll::Question::Answer < ActiveRecord::Base
|
class Poll::Question::Answer < ApplicationRecord
|
||||||
include Galleryable
|
include Galleryable
|
||||||
include Documentable
|
include Documentable
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
belongs_to :answer, class_name: "Poll::Question::Answer", foreign_key: "answer_id"
|
||||||
|
|
||||||
VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/
|
VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Poll
|
class Poll
|
||||||
class Shift < ActiveRecord::Base
|
class Shift < ApplicationRecord
|
||||||
belongs_to :booth
|
belongs_to :booth
|
||||||
belongs_to :officer
|
belongs_to :officer
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class RelatedContent < ActiveRecord::Base
|
class RelatedContent < ApplicationRecord
|
||||||
RELATED_CONTENT_SCORE_THRESHOLD = Setting["related_content_score_threshold"].to_f
|
RELATED_CONTENT_SCORE_THRESHOLD = Setting["related_content_score_threshold"].to_f
|
||||||
RELATIONABLE_MODELS = %w{proposals debates budgets investments}.freeze
|
RELATIONABLE_MODELS = %w{proposals debates budgets investments}.freeze
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class RelatedContentScore < ActiveRecord::Base
|
class RelatedContentScore < ApplicationRecord
|
||||||
SCORES = {
|
SCORES = {
|
||||||
POSITIVE: 1,
|
POSITIVE: 1,
|
||||||
NEGATIVE: -1
|
NEGATIVE: -1
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Topic < ActiveRecord::Base
|
class Topic < ApplicationRecord
|
||||||
acts_as_paranoid column: :hidden_at
|
acts_as_paranoid column: :hidden_at
|
||||||
include ActsAsParanoidAliases
|
include ActsAsParanoidAliases
|
||||||
include Notifiable
|
include Notifiable
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class ValuatorGroup < ActiveRecord::Base
|
class ValuatorGroup < ApplicationRecord
|
||||||
has_many :valuators
|
has_many :valuators
|
||||||
has_many :valuator_group_assignments, dependent: :destroy, class_name: "Budget::ValuatorGroupAssignment"
|
has_many :valuator_group_assignments, dependent: :destroy, class_name: "Budget::ValuatorGroupAssignment"
|
||||||
has_many :investments, through: :valuator_group_assignments, class_name: "Budget::Investment"
|
has_many :investments, through: :valuator_group_assignments, class_name: "Budget::Investment"
|
||||||
|
|||||||
Reference in New Issue
Block a user