Skip to content

Instantly share code, notes, and snippets.

@pvdb
Created May 17, 2012 07:12
Show Gist options
  • Select an option

  • Save pvdb/2717137 to your computer and use it in GitHub Desktop.

Select an option

Save pvdb/2717137 to your computer and use it in GitHub Desktop.
mongoid - git bisect FTW!
#!/usr/bin/env ruby
$:.unshift File.join File.dirname(__FILE__), "lib"
require 'mongoid.rb'
class Shape
include Mongoid::Document
field :x, type: Integer, default: 0
field :y, type: Integer, default: 0
end
class Circle < Shape
field :radius, type: Integer, default: 0
end
class Square < Shape
field :width, type: Integer, default: 0
field :height, type: Integer, default: 0
end
exit Square.fields.keys.include?('radius') ? 1 : 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment