Make Widget::Card translatable

This commit is contained in:
Javi Martín
2018-09-26 15:55:36 +02:00
parent 2c22ab347d
commit 5bb5cfa7fb
7 changed files with 72 additions and 19 deletions

View File

@@ -1,8 +1,15 @@
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
globalize_accessors
def self.header
where(header: true)
end
@@ -10,4 +17,4 @@ class Widget::Card < ActiveRecord::Base
def self.body
where(header: false).order(:created_at)
end
end
end