How do I limit the object of any class to one. My class looks like :
class Speaker
include Mongoid::Document
field :name, :type => String
end
I just want to let a single instance of speaker . One way would be to add a validation which would check the number of objects already present of the Speaker class. Is there a ruby way of doing thing ?