Telly runs a simple HTTP server which mounts onto your Rails app in development, and provides a simple interface for Rubocop to fetch runtime information about your app. Check Features below to see what it can currently do.
- Linting for routes
- Check that a specified controller action exists
- Linting
belongs_to
,has_many
andhas_one
relationships in models- Check that specified primary and foreign keys exist in a relationship
- Check that foreign key and primary key types match
- Check that the related model still has a table in the DB
- Check that non-nullable columns in a DB table have corresponding not-null constraints at the application level
- Check that ActiveRecord uniqueness validations have a corresponding index in the DB (performance)
- Check that properties mentioned in ActiveRecord's DSL correspond to DB columns in the model's table
Install the gem and then that's it! Configure your .rubocop.yml
to enable/disable whichever rules
you like
Add this line to your application's Gemfile:
gem "telly", group: :development
And then execute:
$ bundle
Or install it yourself as:
$ gem install telly
The gem is available as open source under the terms of the MIT License.