Class: RuboCop::Cop::Rails::ModelAssociationConsistentSpacing
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Rails::ModelAssociationConsistentSpacing
- Defined in:
- lib/rubocop/cop/rails/model_association_consistent_spacing.rb
Constant Summary collapse
- MSG =
'Do not leave blank lines between associations of the same type.'- ASSOCIATION_METHODS =
[ :belongs_to, :has_one, :has_many, :has_and_belongs_to_many ].freeze
Instance Method Summary collapse
Instance Method Details
#on_class(node) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/rubocop/cop/rails/model_association_consistent_spacing.rb', line 15 def on_class(node) return unless model_class?(node) associations = find_associations(node) return if associations.empty? check_consistent_spacing(associations) end |