Here are a couple of examples of one-liners that go way beyond 80 characters:
scope = DepartmentRepository.includes(:location).by_account(@request.account_id).find(approved_department_ids) departments = ActiveModel::ArraySerializer.new(scope, each_serializer: DepartmentWithLocationSerializer).as_json
I usually simply break these kinds of chained method calls before the
. and indent the next line. My IDE (Emacs) runs rubocop on my source files as I edit them and doesn't complain about this practice. It does complain about lines longer than 80 characters so I feel somewhat compelled to fix them. How would I refactor these? The first line is calling
ActiveRecord finders and scopes. Scopes can be compbined but then they have ackward names that seldom see reuse (e.g.