lib/sequel/model.rb in sequel-0.4.2.2 vs lib/sequel/model.rb in sequel-0.4.3
- old
+ new
@@ -253,9 +253,12 @@
dataset.filter(*args, &block).first
end
def self.[](*args)
args = args.first if (args.size == 1)
+ if args === true || args === false
+ raise SequelError, "Invalid filter specified. Did you mean to supply a hash?"
+ end
dataset[(Hash === args) ? args : primary_key_hash(args)]
end
def self.fetch(*args)
db.fetch(*args).set_model(self)