about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/glitch.rb7
-rw-r--r--app/models/glitch/keyword_mute.rb (renamed from app/models/keyword_mute.rb)6
2 files changed, 10 insertions, 3 deletions
diff --git a/app/models/glitch.rb b/app/models/glitch.rb
new file mode 100644
index 000000000..0e497babc
--- /dev/null
+++ b/app/models/glitch.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+module Glitch
+  def self.table_name_prefix
+    'glitch_'
+  end
+end
diff --git a/app/models/keyword_mute.rb b/app/models/glitch/keyword_mute.rb
index b0229923d..3b0b47f52 100644
--- a/app/models/keyword_mute.rb
+++ b/app/models/glitch/keyword_mute.rb
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 # == Schema Information
 #
-# Table name: keyword_mutes
+# Table name: glitch_keyword_mutes
 #
 #  id         :integer          not null, primary key
 #  account_id :integer          not null
@@ -11,7 +11,7 @@
 #  updated_at :datetime         not null
 #
 
-class KeywordMute < ApplicationRecord
+class Glitch::KeywordMute < ApplicationRecord
   belongs_to :account, required: true
 
   validates_presence_of :keyword
@@ -33,7 +33,7 @@ class KeywordMute < ApplicationRecord
 
     def initialize(account_id)
       re = [].tap do |arr|
-        KeywordMute.where(account_id: account_id).select(:keyword, :id, :whole_word).find_each do |m|
+        Glitch::KeywordMute.where(account_id: account_id).select(:keyword, :id, :whole_word).find_each do |m|
           boundary = m.whole_word ? '\b' : ''
           arr << "#{boundary}#{Regexp.escape(m.keyword.strip)}#{boundary}"
         end