$LOAD_PATH << '../lib' require 'active_record' require 'mongoid' require 'html_format' Mongo::Logger.logger.level = Logger::INFO Mongoid::Config.connect_to('test') Mongoid::Clients.default.database.drop class User include Mongoid::Document field :name, type: String end ['alice', 'bob', 'carol'].each { |e| User.create!(name: e) } html_format User # => "
_id | name |
---|---|
5b34406cf6453f07063d4dd3 | alice |
5b34406cf6453f07063d4dd4 | bob |
5b34406cf6453f07063d4dd5 | carol |
_id | 5b34406cf6453f07063d4dd3 |
---|---|
name | alice |
_id | name |
---|---|
5b34406cf6453f07063d4dd3 | alice |
_id | name |
---|---|
5b34406cf6453f07063d4dd3 | alice |
5b34406cf6453f07063d4dd4 | bob |
5b34406cf6453f07063d4dd5 | carol |
_id | 5b34406cf6453f07063d4dd3 |
---|---|
name | alice |
_id | name |
---|---|
5b34406cf6453f07063d4dd3 | alice |