Sha256: 93b8e10a875812716de8b8c61e7c39453f3e06026bdd1cc31523e1677a0c5cbf
Contents?: true
Size: 940 Bytes
Versions: 7
Compression:
Stored size: 940 Bytes
Contents
require 'rubygems' require 'test/unit' require 'bundler/setup' require 'shoulda' require 'mongoid' require 'slugoid' $LOAD_PATH.unshift(File.dirname(__FILE__)) module Acts::Slugoid::Test module Config def setup ::Mongoid.configure do |config| name = "slugoid_test" host = "localhost" config.master = Mongo::Connection.new.db(name) config.logger = nil end end def teardown ::Mongoid.master.collections.select {|c| c.name !~ /system/ }.each(&:drop) end end end class Project include Mongoid::Document field :name, :type => String end class SlugoidProject include Mongoid::Document field :name, :type => String acts_as_slugoid end class Organization include Mongoid::Document acts_as_slugoid :generate_from => :alternative_name, :store_as => :alternative_slug field :alternative_name, :type => String field :alternative_slug, :type => String end
Version data entries
7 entries across 7 versions & 2 rubygems