makes models inherit from ApplicationRecord
This commit is contained in:
committed by
Julian Herrero
parent
1cec362ba7
commit
7ab602175a
@@ -1,4 +1,4 @@
|
|||||||
class Budget < ActiveRecord::Base
|
class Budget < ApplicationRecord
|
||||||
|
|
||||||
include Measurable
|
include Measurable
|
||||||
include Sluggable
|
include Sluggable
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Budget
|
class Budget
|
||||||
class Ballot < ActiveRecord::Base
|
class Ballot < ApplicationRecord
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :budget
|
belongs_to :budget
|
||||||
belongs_to :poll_ballot, class_name: "Poll::Ballot"
|
belongs_to :poll_ballot, class_name: "Poll::Ballot"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class Budget
|
class Budget
|
||||||
class Ballot
|
class Ballot
|
||||||
class Line < ActiveRecord::Base
|
class Line < ApplicationRecord
|
||||||
belongs_to :ballot
|
belongs_to :ballot
|
||||||
belongs_to :investment, counter_cache: :ballot_lines_count
|
belongs_to :investment, counter_cache: :ballot_lines_count
|
||||||
belongs_to :heading
|
belongs_to :heading
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Budget
|
class Budget
|
||||||
class Group < ActiveRecord::Base
|
class Group < ApplicationRecord
|
||||||
include Sluggable
|
include Sluggable
|
||||||
|
|
||||||
translates :name, touch: true
|
translates :name, touch: true
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Budget
|
class Budget
|
||||||
class Heading < ActiveRecord::Base
|
class Heading < ApplicationRecord
|
||||||
OSM_DISTRICT_LEVEL_ZOOM = 12.freeze
|
OSM_DISTRICT_LEVEL_ZOOM = 12.freeze
|
||||||
|
|
||||||
include Sluggable
|
include Sluggable
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Budget
|
class Budget
|
||||||
class Investment < ActiveRecord::Base
|
class Investment < ApplicationRecord
|
||||||
SORTING_OPTIONS = {id: "id", title: "title", supports: "cached_votes_up"}.freeze
|
SORTING_OPTIONS = {id: "id", title: "title", supports: "cached_votes_up"}.freeze
|
||||||
|
|
||||||
include Rails.application.routes.url_helpers
|
include Rails.application.routes.url_helpers
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Budget
|
class Budget
|
||||||
class ReclassifiedVote < ActiveRecord::Base
|
class ReclassifiedVote < ApplicationRecord
|
||||||
REASONS = %w(heading_changed unfeasible)
|
REASONS = %w(heading_changed unfeasible)
|
||||||
|
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Budget
|
class Budget
|
||||||
class ValuatorAssignment < ActiveRecord::Base
|
class ValuatorAssignment < ApplicationRecord
|
||||||
belongs_to :valuator, counter_cache: :budget_investments_count
|
belongs_to :valuator, counter_cache: :budget_investments_count
|
||||||
belongs_to :investment, counter_cache: true
|
belongs_to :investment, counter_cache: true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Legislation::Annotation < ActiveRecord::Base
|
class Legislation::Annotation < ApplicationRecord
|
||||||
COMMENTS_PAGE_SIZE = 5
|
COMMENTS_PAGE_SIZE = 5
|
||||||
acts_as_paranoid column: :hidden_at
|
acts_as_paranoid column: :hidden_at
|
||||||
include ActsAsParanoidAliases
|
include ActsAsParanoidAliases
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Legislation::Answer < ActiveRecord::Base
|
class Legislation::Answer < ApplicationRecord
|
||||||
acts_as_paranoid column: :hidden_at
|
acts_as_paranoid column: :hidden_at
|
||||||
include ActsAsParanoidAliases
|
include ActsAsParanoidAliases
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Legislation::DraftVersion < ActiveRecord::Base
|
class Legislation::DraftVersion < ApplicationRecord
|
||||||
VALID_STATUSES = %w(draft published)
|
VALID_STATUSES = %w(draft published)
|
||||||
|
|
||||||
acts_as_paranoid column: :hidden_at
|
acts_as_paranoid column: :hidden_at
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Legislation::Process < ActiveRecord::Base
|
class Legislation::Process < ApplicationRecord
|
||||||
include ActsAsParanoidAliases
|
include ActsAsParanoidAliases
|
||||||
include Taggable
|
include Taggable
|
||||||
include Milestoneable
|
include Milestoneable
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Legislation::Question < ActiveRecord::Base
|
class Legislation::Question < 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 Legislation::QuestionOption < ActiveRecord::Base
|
class Legislation::QuestionOption < ApplicationRecord
|
||||||
acts_as_paranoid column: :hidden_at
|
acts_as_paranoid column: :hidden_at
|
||||||
include ActsAsParanoidAliases
|
include ActsAsParanoidAliases
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Poll < ActiveRecord::Base
|
class Poll < ApplicationRecord
|
||||||
include Imageable
|
include Imageable
|
||||||
acts_as_paranoid column: :hidden_at
|
acts_as_paranoid column: :hidden_at
|
||||||
include ActsAsParanoidAliases
|
include ActsAsParanoidAliases
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Poll::Answer < ActiveRecord::Base
|
class Poll::Answer < ApplicationRecord
|
||||||
|
|
||||||
belongs_to :question, -> { with_hidden }
|
belongs_to :question, -> { with_hidden }
|
||||||
belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id"
|
belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Poll
|
class Poll
|
||||||
class Booth < ActiveRecord::Base
|
class Booth < ApplicationRecord
|
||||||
has_many :booth_assignments, class_name: "Poll::BoothAssignment"
|
has_many :booth_assignments, class_name: "Poll::BoothAssignment"
|
||||||
has_many :polls, through: :booth_assignments
|
has_many :polls, through: :booth_assignments
|
||||||
has_many :shifts
|
has_many :shifts
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Poll
|
class Poll
|
||||||
class BoothAssignment < ActiveRecord::Base
|
class BoothAssignment < ApplicationRecord
|
||||||
belongs_to :booth
|
belongs_to :booth
|
||||||
belongs_to :poll
|
belongs_to :poll
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Poll
|
class Poll
|
||||||
class Officer < ActiveRecord::Base
|
class Officer < ApplicationRecord
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
has_many :officer_assignments, class_name: "Poll::OfficerAssignment"
|
has_many :officer_assignments, class_name: "Poll::OfficerAssignment"
|
||||||
has_many :shifts, class_name: "Poll::Shift"
|
has_many :shifts, class_name: "Poll::Shift"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Poll
|
class Poll
|
||||||
class OfficerAssignment < ActiveRecord::Base
|
class OfficerAssignment < ApplicationRecord
|
||||||
belongs_to :officer
|
belongs_to :officer
|
||||||
belongs_to :booth_assignment
|
belongs_to :booth_assignment
|
||||||
has_many :ballot_sheets
|
has_many :ballot_sheets
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Poll::PartialResult < ActiveRecord::Base
|
class Poll::PartialResult < ApplicationRecord
|
||||||
|
|
||||||
VALID_ORIGINS = %w{web booth}
|
VALID_ORIGINS = %w{web booth}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Poll::Question < ActiveRecord::Base
|
class Poll::Question < ApplicationRecord
|
||||||
include Measurable
|
include Measurable
|
||||||
include Searchable
|
include Searchable
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Poll::Recount < ActiveRecord::Base
|
class Poll::Recount < ApplicationRecord
|
||||||
|
|
||||||
VALID_ORIGINS = %w{web booth letter}.freeze
|
VALID_ORIGINS = %w{web booth letter}.freeze
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Poll
|
class Poll
|
||||||
class Voter < ActiveRecord::Base
|
class Voter < ApplicationRecord
|
||||||
|
|
||||||
VALID_ORIGINS = %w{web booth}.freeze
|
VALID_ORIGINS = %w{web booth}.freeze
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Signature < ActiveRecord::Base
|
class Signature < ApplicationRecord
|
||||||
belongs_to :signature_sheet
|
belongs_to :signature_sheet
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class SignatureSheet < ActiveRecord::Base
|
class SignatureSheet < ApplicationRecord
|
||||||
belongs_to :signable, polymorphic: true
|
belongs_to :signable, polymorphic: true
|
||||||
belongs_to :author, class_name: "User", foreign_key: "author_id"
|
belongs_to :author, class_name: "User", foreign_key: "author_id"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class SiteCustomization::ContentBlock < ActiveRecord::Base
|
class SiteCustomization::ContentBlock < ApplicationRecord
|
||||||
VALID_BLOCKS = %w[top_links footer subnavigation_left subnavigation_right]
|
VALID_BLOCKS = %w[top_links footer subnavigation_left subnavigation_right]
|
||||||
|
|
||||||
validates :locale, presence: true, inclusion: { in: I18n.available_locales.map(&:to_s) }
|
validates :locale, presence: true, inclusion: { in: I18n.available_locales.map(&:to_s) }
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class SiteCustomization::Image < ActiveRecord::Base
|
class SiteCustomization::Image < ApplicationRecord
|
||||||
VALID_IMAGES = {
|
VALID_IMAGES = {
|
||||||
"logo_header" => [260, 80],
|
"logo_header" => [260, 80],
|
||||||
"social_media_icon" => [470, 246],
|
"social_media_icon" => [470, 246],
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class SiteCustomization::Page < ActiveRecord::Base
|
class SiteCustomization::Page < ApplicationRecord
|
||||||
VALID_STATUSES = %w[draft published]
|
VALID_STATUSES = %w[draft published]
|
||||||
has_many :cards, class_name: "Widget::Card", foreign_key: "site_customization_page_id"
|
has_many :cards, class_name: "Widget::Card", foreign_key: "site_customization_page_id"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user