added associations between cards and pages models
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
class SiteCustomization::Page < ActiveRecord::Base
|
class SiteCustomization::Page < ActiveRecord::Base
|
||||||
VALID_STATUSES = %w(draft published)
|
VALID_STATUSES = %w(draft published)
|
||||||
|
has_many :cards, class_name: 'Widget::Card', foreign_key: 'site_customization_page_id'
|
||||||
|
|
||||||
translates :title, touch: true
|
translates :title, touch: true
|
||||||
translates :subtitle, touch: true
|
translates :subtitle, touch: true
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Widget::Card < ActiveRecord::Base
|
class Widget::Card < ActiveRecord::Base
|
||||||
include Imageable
|
include Imageable
|
||||||
|
belongs_to :page, class_name: 'SiteCustomization::Page', foreign_key: 'site_customization_page_id'
|
||||||
|
|
||||||
# table_name must be set before calls to 'translates'
|
# table_name must be set before calls to 'translates'
|
||||||
self.table_name = "widget_cards"
|
self.table_name = "widget_cards"
|
||||||
|
|||||||
Reference in New Issue
Block a user