Simplify widget table prefix
The same way it's done in other modules.
This commit is contained in:
5
app/models/widget.rb
Normal file
5
app/models/widget.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
module Widget
|
||||||
|
def self.table_name_prefix
|
||||||
|
"widget_"
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -5,9 +5,6 @@ class Widget::Card < ApplicationRecord
|
|||||||
foreign_key: "site_customization_page_id",
|
foreign_key: "site_customization_page_id",
|
||||||
inverse_of: :cards
|
inverse_of: :cards
|
||||||
|
|
||||||
# table_name must be set before calls to 'translates'
|
|
||||||
self.table_name = "widget_cards"
|
|
||||||
|
|
||||||
translates :label, touch: true
|
translates :label, touch: true
|
||||||
translates :title, touch: true
|
translates :title, touch: true
|
||||||
translates :description, touch: true
|
translates :description, touch: true
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
class Widget::Feed < ApplicationRecord
|
class Widget::Feed < ApplicationRecord
|
||||||
self.table_name = "widget_feeds"
|
|
||||||
|
|
||||||
KINDS = %w[proposals debates processes].freeze
|
KINDS = %w[proposals debates processes].freeze
|
||||||
|
|
||||||
def active?
|
def active?
|
||||||
|
|||||||
Reference in New Issue
Block a user