diff --git a/app/models/application_record.rb b/app/models/application_record.rb index d0bdfc17e..5b881b4b8 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -43,5 +43,13 @@ class ApplicationRecord < ActiveRecord::Base end end + concerning :PostgresExtensions do + class_methods do + def columns(*params) + super.reject {|x| x.sql_type == "tsvector"} + end + end + end + include ApiMethods end diff --git a/app/models/comment.rb b/app/models/comment.rb index be656fc88..a2e4dff71 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -260,5 +260,3 @@ class Comment < ApplicationRecord DText.quote(body, creator_name) end end - -Comment.connection.extend(PostgresExtensions) diff --git a/app/models/post.rb b/app/models/post.rb index 1a25add2e..cd3619fd6 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -1797,5 +1797,3 @@ class Post < ApplicationRecord ret end end - -Post.connection.extend(PostgresExtensions) diff --git a/config/initializers/postgres_extensions.rb b/config/initializers/postgres_extensions.rb deleted file mode 100644 index 993494466..000000000 --- a/config/initializers/postgres_extensions.rb +++ /dev/null @@ -1,5 +0,0 @@ -module PostgresExtensions - def columns(*params) - super.reject {|x| x.sql_type == "tsvector"} - end -end