Module: Nifty::Utils::ActiveRecord::RandomString::ClassMethods

Defined in:
lib/nifty/utils/active_record/random_string.rb

Instance Method Summary collapse

Instance Method Details

#has_random_strings?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/nifty/utils/active_record/random_string.rb', line 26

def has_random_strings?
  false
end

#random_string(field, options = {}) ⇒ Object



30
31
32
33
# File 'lib/nifty/utils/active_record/random_string.rb', line 30

def random_string(field, options = {})
  self.send :include, ModelExtensions unless self.has_random_strings?
  self.random_string_fields[field] = options
end