-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with DatabaseConsistency::Checkerrs::MissingAssociationClassChecker
#248
Comments
Also fails on another checker:
|
If I add a little hack into def _klass(class_name) # :nodoc:
if active_record.name.demodulize == class_name
return compute_class("::#{class_name}") rescue NameError
end
if class_name == 'Locatable'
class_name = "LocalityInformation"
puts "Renamed #{class_name} ~~~~********"
puts "#{compute_class(class_name)} ~~~~~"
puts "######"
else
# puts class_name
end
compute_class(class_name)
end I then get the errors,
Our class LocalityInformation < ApplicationRecord
self.table_name = "locality_information"
belongs_to :locatable, polymorphic: true, optional: true |
I'm trying to integrate |
Hi @lloydwatkin! Thank you for using the gem and reporting the issues! I haven't yet finished reading all of them, but at least it looks manageable to fix first. Would you like to contribute? I will support you with the PR review and release. If you can't, I will do my best to fix it and check others as soon as possible. |
Oh, I just finished reading. There is only one problem with the way the gem determines an association class.
Yes, you can disable the checks temporarily with the Something like: User:
locatable:
ForeignKeyTypeChecker:
enabled: false
Story:
locatable:
ForeignKeyTypeChecker:
enabled: false |
The
locatable
association is in a concern (included below). The model itself extendsApplicationRecord
which itself extendsActiveRecord::Base
however this is the same for all of our models.Have also tried it as follows with the same error:
The text was updated successfully, but these errors were encountered: