Replace occurrences of ActiveRecord::Base on new models

This commit is contained in:
Angel Perez
2018-08-07 15:23:22 -04:00
committed by Julian Herrero
parent 26b213c186
commit 129411864e
6 changed files with 6 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
class Banner::Section < ActiveRecord::Base class Banner::Section < ApplicationRecord
belongs_to :banner belongs_to :banner
belongs_to :web_section belongs_to :web_section
end end

View File

@@ -1,4 +1,4 @@
class I18nContent < ActiveRecord::Base class I18nContent < ApplicationRecord
scope :by_key, ->(key) { where(key: key) } scope :by_key, ->(key) { where(key: key) }
scope :begins_with_key, ->(key) { where("key ILIKE ?", "#{key}%") } scope :begins_with_key, ->(key) { where("key ILIKE ?", "#{key}%") }

View File

@@ -1,4 +1,4 @@
class I18nContentTranslation < ActiveRecord::Base class I18nContentTranslation < ApplicationRecord
def self.existing_languages def self.existing_languages
self.select(:locale).distinct.map { |l| l.locale.to_sym }.to_a self.select(:locale).distinct.map { |l| l.locale.to_sym }.to_a
end end

View File

@@ -1,4 +1,4 @@
class WebSection < ActiveRecord::Base class WebSection < ApplicationRecord
has_many :sections has_many :sections
has_many :banners, through: :sections has_many :banners, through: :sections
end end

View File

@@ -1,4 +1,4 @@
class Widget::Card < ActiveRecord::Base class Widget::Card < ApplicationRecord
include Imageable include Imageable
belongs_to :page, class_name: "SiteCustomization::Page", foreign_key: "site_customization_page_id" belongs_to :page, class_name: "SiteCustomization::Page", foreign_key: "site_customization_page_id"

View File

@@ -1,4 +1,4 @@
class Widget::Feed < ActiveRecord::Base class Widget::Feed < ApplicationRecord
self.table_name = "widget_feeds" self.table_name = "widget_feeds"
KINDS = %w(proposals debates processes) KINDS = %w(proposals debates processes)