Files
grecia/app/models/widget/card.rb
Javi Martín 2ab49a1832 Refactor globalize models code using a concern
I've chosen the name "Globalizable" because "Translatable" already
existed.
2018-10-22 16:28:53 +02:00

21 lines
452 B
Ruby

class Widget::Card < ActiveRecord::Base
include Imageable
# 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).order(:created_at)
end
end