Permalink
Browse files

Digest::SHA2.hexdigest instead of MD5.hexdigest

(for Ruby 1.9 compatbility)
  • Loading branch information...
1 parent 8c8f79d commit edf7c56d9f9746a957bfc0fe67a2d058d8e79b25 @nertzy nertzy committed May 11, 2011
Showing with 5 additions and 3 deletions.
  1. +3 −1 lib/pg_search/configuration/association.rb
  2. +2 −2 lib/pg_search/configuration/column.rb
@@ -1,3 +1,5 @@
+require "digest"
+
module PgSearch
class Configuration
class Association
@@ -25,7 +27,7 @@ def join(primary_key)
def subselect_alias
subselect_name = ["pg_search", table_name, @name, "subselect"].compact.join('_')
- "pg_search_#{MD5.hexdigest(subselect_name)}"
+ "pg_search_#{Digest::SHA2.hexdigest(subselect_name)}"
end
end
end
@@ -1,4 +1,4 @@
-require 'md5'
+require 'digest'
module PgSearch
class Configuration
@@ -35,7 +35,7 @@ def foreign?
def alias
name = [association.subselect_alias, @column_name].compact.join('_')
- "pg_search_#{MD5.hexdigest(name)}"
+ "pg_search_#{Digest::SHA2.hexdigest(name)}"
end
end
end

0 comments on commit edf7c56

Please sign in to comment.