Simplify widget table prefix

The same way it's done in other modules.
This commit is contained in:
Javi Martín
2021-01-06 19:37:30 +01:00
parent e8e920ee50
commit 04e817e696
3 changed files with 5 additions and 5 deletions

5
app/models/widget.rb Normal file
View File

@@ -0,0 +1,5 @@
module Widget
def self.table_name_prefix
"widget_"
end
end

View File

@@ -5,9 +5,6 @@ class Widget::Card < ApplicationRecord
foreign_key: "site_customization_page_id",
inverse_of: :cards
# 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

View File

@@ -1,6 +1,4 @@
class Widget::Feed < ApplicationRecord
self.table_name = "widget_feeds"
KINDS = %w[proposals debates processes].freeze
def active?