Replace occurrences of ActiveRecord::Base on new models
This commit is contained in:
committed by
Julian Herrero
parent
26b213c186
commit
129411864e
@@ -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
|
||||||
|
|||||||
@@ -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}%") }
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user