0

Concerns is a tool I'm pretty sure I won't use in the future. Are there any reservations as to deleting these completely from controllers/models folders?

sawa
  • 165,429
  • 45
  • 277
  • 381
sloneorzeszki
  • 1,274
  • 3
  • 12
  • 22

1 Answers1

1

Very often, concerns are used to reduce the size of a class. This is even more common in projects using tools such as Rubocop in their CI process. In those situations, when a file exceeds a particular threshold, the quickest solution is to extract a concern. The logic is moved elsewhere and the number of lines of that class is reduced.

So, It's not mandatory to have concerns in your app. you can include them or not as per your code needs.

Vishal
  • 818
  • 8
  • 20
  • Thanks. I know what they are used for, just didn't know if anything in Rails internally requires them even if unused. FYI extracting code just for the sake of making the file smaller is just hiding complexity. In my book it doesn't solve any problems, just makes them harder to see. – sloneorzeszki Mar 18 '19 at 09:34