This code was introduced in commit722a431b, but it stopped being used in commit7657a0e0. The spec was failing sometimes because the method didn't order the records, but the spec checked the records returned in a certain order. Furthermore, the method `page` generated a potential conflict with kaminari's `page method.
22 lines
585 B
Ruby
22 lines
585 B
Ruby
class Widget::Card < ApplicationRecord
|
|
include Imageable
|
|
belongs_to :page, class_name: "SiteCustomization::Page", foreign_key: "site_customization_page_id"
|
|
|
|
# table_name must be set before calls to 'translates'
|
|
self.table_name = "widget_cards"
|
|
|
|
translates :label, touch: true
|
|
translates :title, touch: true
|
|
translates :description, touch: true
|
|
translates :link_text, touch: true
|
|
include Globalizable
|
|
|
|
def self.header
|
|
where(header: true)
|
|
end
|
|
|
|
def self.body
|
|
where(header: false, site_customization_page_id: nil).order(:created_at)
|
|
end
|
|
end
|