This gem is adding shortcuts for Integer and Array classes so you can call
to_XXXXX method and get object or relation object.
For example you have classes
User, Company in your app.
You can do the following:
1.to_user which is equat to
And then execute:
Or install it yourself as:
$ gem install just_for_fun
lib/tasks/railtie.rb. When app is starting gem is defining such methods.
- improve performance, looks like it has impact on it
For Rails 6
in development.rb to preload all models.
Rails.application.configure do config.eager_load = true end
You are welcome to contribute.
The gem is available as open source under the terms of the MIT License.