Class: RuboCop::Cop::Rails::ModelAssociationSeparation
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Rails::ModelAssociationSeparation
- Defined in:
- lib/rubocop/cop/rails/model_association_separation.rb
Constant Summary collapse
- MSG =
'Separate different association types with a blank line.'- 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_separation.rb', line 15 def on_class(node) return unless model_class?(node) associations = find_associations(node) return if associations.size < 2 check_association_separation(associations) end |