lib/rails_erd/domain.rb in rails-erd-1.2.2 vs lib/rails_erd/domain.rb in rails-erd-1.3.0
- old
+ new
@@ -112,11 +112,11 @@
end
end
end
def models
- @models ||= @source_models.select { |model| check_model_validity(model) }
+ @models ||= @source_models.select { |model| check_model_validity(model) }.reject { |model| check_habtm_model(model) }
end
def associations
@associations ||= models.collect(&:reflect_on_all_associations).flatten.select { |assoc| check_association_validity(assoc) }
end
@@ -142,8 +142,12 @@
warn "Ignoring invalid association #{association_description(association)} (#{e.message})"
end
def association_description(association)
"#{association.name.inspect} on #{association.active_record}"
+ end
+
+ def check_habtm_model(model)
+ model.name.start_with?("HABTM_")
end
end
end