Module: ActsAsTaggableOn::Utils::OverallMethods

Defined in:
lib/acts_as_taggable_on/utils.rb

Instance Method Summary collapse

Instance Method Details

#sha_prefix(string) ⇒ Object



18
19
20
# File 'lib/acts_as_taggable_on/utils.rb', line 18

def sha_prefix(string)
  Digest::SHA1.hexdigest("#{string}#{rand}")[0..6]
end

#using_postgresql?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/acts_as_taggable_on/utils.rb', line 10

def using_postgresql?
  ::ActiveRecord::Base.connection && ::ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
end

#using_sqlite?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/acts_as_taggable_on/utils.rb', line 14

def using_sqlite?
  ::ActiveRecord::Base.connection && ::ActiveRecord::Base.connection.adapter_name == 'SQLite'
end