NoBrainerORM / nobrainer

Ruby ORM for RethinkDB
http://nobrainer.io/
Other
387 stars 49 forks source link

Missing ActiveRecord-like `exists?` method #250

Open zedtux opened 5 years ago

zedtux commented 5 years ago

This method ease the code readability I believe :

User.exists?(username: 'nviennot')

instead of

User.where(username: 'nviennot').present?
zedtux commented 5 years ago

BTW here is the AR implementation: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/relation/finder_methods.rb#L300