def has_random_unique_id(options={})
      options = RandomUniqueId.config.merge(options)
      before_validation :populate_rid_field, if: Proc.new { |r| r.send(options[:field]).blank? }
      add_rid_related_validations(options)
      add_rid_related_methods(options)
    end
def has_random_unique_id(options={})
      options = RandomUniqueId.config.merge(options)
      before_validation :populate_rid_field, if: Proc.new { |r| r.send(options[:field]).blank? }
      add_rid_related_validations(options)
      add_rid_related_methods(options)
    end
Mark a model as containing a random unique id. A field called rid of type string is required. It's recommended
 that it's indexed and unique. For example, you could add it to a migration like this:
   def up
     add_column :posts, :rid, :string
     add_index :posts, :rid, :unique
   end

 and then to the model like this:
   class Post
     has_random_unique_id
     # ... other stuff
   end

 @param options [Hash] generation options, same as RandomUniqueID.config, in case the generation method or minimum
   length needs to be overridden for one specific model