Move PostgresExtensions to ApplicationRecord.

This commit is contained in:
evazion
2017-11-25 21:07:45 -06:00
parent 8a0f600ac2
commit 5b89f56c2e
4 changed files with 8 additions and 9 deletions

View File

@@ -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

View File

@@ -260,5 +260,3 @@ class Comment < ApplicationRecord
DText.quote(body, creator_name)
end
end
Comment.connection.extend(PostgresExtensions)

View File

@@ -1797,5 +1797,3 @@ class Post < ApplicationRecord
ret
end
end
Post.connection.extend(PostgresExtensions)

View File

@@ -1,5 +0,0 @@
module PostgresExtensions
def columns(*params)
super.reject {|x| x.sql_type == "tsvector"}
end
end