rails_best_practices icon indicating copy to clipboard operation
rails_best_practices copied to clipboard

a code metric tool for rails projects

Results 63 rails_best_practices issues
Sort by recently updated
recently updated
newest added

Hey there! Some weeks ago I tried out the RailsBestPractices hook with [Overcommit](https://github.com/sds/overcommit) to no avail. I [opened an issue](https://github.com/sds/overcommit/issues/693) to ask about my problem, and it turns out it...

We override `verified_request?` to work around some kind of issue where JSON requests were getting rejected because they didn't have a CSRF token: ``` class ApplicationController # ... omitting other...

I'm using the gem FriendlyId so one of my model does: ``` extend FriendlyId ``` So in the model I have: ``` def should_generate_new_friendly_id? ``` And so the method is...

If a controller inherits from another controller and uses some action from the super class, **rails_best_practice** does not recognize the inheritance and says `restrict auto-generated routes`. Example ``` ruby class...

Hi, I'm using rails 5.1.5 and rails_best_practices 1.16.0. I'm trying to use resources with a concern in the routes.rb but I'm having this error: > restrict auto-generated routes (only: [])...

As the title says, an unused helper method was crashing the system. I fixed it by monkey patching into /core/check.rb:347 and changing this like: ``` @except_methods + internal_except_methods ``` to...

Hi, I've tried to write my own checklist for migration, and I want to skip some migration files. I thought I could use `rails_best_practices.yml` to ignore these files. But it...

Hi, I'm making rails_best_practices plugin for [pre-commit gem](https://github.com/jish/pre-commit). So, I want to call rails_best_practices checks from program like this code. https://github.com/jish/pre-commit/blob/master/lib/plugins/pre_commit/checks/rubocop.rb#L32 ```ruby ::RuboCop::CLI.new.run(args) == 0 ``` I check [command.rb file](https://github.com/flyerhzm/rails_best_practices/blob/master/lib/rails_best_practices/command.rb)...

**move model logic into model (command use_count > 4)** I got this error while calling a service from controller. Isn't services the best way rather than making models fat ?

I'd like to be able to _temporarily_ disable a rule inline in the code using a comment (e.g., "# rails_best_practice:disable RULE"... "# rails_best_practice:enable RULE"), like rubocop. Please document it, too!...