Module: ActiveRecord::Sentry

Defined in:
lib/active_record/sentry.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

@@CHARS =
('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:


3
4
5
# File 'lib/active_record/sentry.rb', line 3

def self.included(base) # :nodoc:
  base.extend ClassMethods
end

.rand_string(length = 8) ⇒ Object


96
97
98
99
100
# File 'lib/active_record/sentry.rb', line 96

def self.rand_string(length=8)
  s=''
  length.times{ s << @@CHARS[rand(@@CHARS.length)] }
  s
end