Skip to content

phuongnd08/id_asc

Repository files navigation

IdAsc

ActiveRecord .first is not predictable - it may or may not returns the first record based on what happened before it being called

This gem add .id_asc scope to every ActiveRecord model. So we can get rid of all .first surprise by simply use collection.id_asc.first

Installation

Add this line to your application's Gemfile:

gem 'id_asc'

Every ActiveRecord inherited class will now have id_asc method which is equivalent to order(id: :asc)

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages