awesome-print / awesome_print

Pretty print your Ruby objects with style -- in full color and with proper indentation
http://github.com/michaeldv/awesome_print
MIT License
4.07k stars 454 forks source link

Adding support for Mongoid 3 and Moped #97

Closed nikolajsen closed 12 years ago

nikolajsen commented 12 years ago

Upgrading from Mongoid 2 to Mongoid 3 I realized the awesome_print gem depended on the bson gem. Mongoid 3 uses the Moped driver instead of the Mongo driver, and BSON references should be changed to Moped::BSON. Tests should be fixed also...

sheharyarn commented 9 years ago

Still not _awesome printing_ on my Mongoid app.

ruby >> ap Tournament.limit(2).all
#<Mongoid::Criteria
  selector: {}
  options:  {:limit=>2}
  class:    Tournament
  embedded: false>

and

ruby >> ap Tournament.limit(2).all.to_a
[
    [0] #<Tournament _id: 54604892416972aa89010000, created_at: 2014-11-10 05:09:38 UTC, updated_at: 2014-11-10 05:15:06 UTC, title: "TT1", type: "Arma 3", description: "", rules: "", prize: "1", max_participants: nil, date: 2014-11-20 00:00:00 UTC, time: "4:56am", time_zone: "Pacific Time (US & Canada)", start: true, casual_players: [], tournament_type: "Open", tournament_mode: "Casual", tournament_bracket: "Single Elimination", player_id: BSON::ObjectId('546042d4416972aa83320000')>,
    [1] #<Tournament _id: 546c481d416972f6f1050000, created_at: 2014-11-19 07:34:53 UTC, updated_at: 2014-11-19 07:36:04 UTC, title: "Dota", type: "Dota 2", description: "", rules: "", prize: "1", max_participants: nil, date: 2014-11-20 00:00:00 UTC, time: "1:00am", time_zone: "Arizona", start: true, casual_players: [], tournament_type: "Open", tournament_mode: "Casual", tournament_bracket: "Single Elimination", player_id: BSON::ObjectId('546042d4416972aa83320000')>
]

BTW I'm using ruby 2.0 with rails 4.0 and mongoid 4.0.