The ContactCompany model declares validate :must_belong_to_same_account but the method is
never defined in the class. Any attempt to create a
contact ↔ company link crashes with NoMethodError
before the record is even saved.
Affected file
app/models/contact_company.rb
validate :must_belong_to_same_account
# ...but no def must_belong_to_same_account anywhere
in the class or included modules
Reproduction
Single-tenant community install, fresh.
curl -X POST "https://api-crm.example.com/api/v1/con
tacts/<person_uuid>/companies" \
-H "api_access_token: ..." \
-H "Content-Type: application/json" \
-d '{"company_id":"<company_uuid>"}'
Or via Rails console:
Contacts::LinkCompanyService.new(contact:
Contact.find(<person>), company:
Contact.find(<company>)).perform
# => {success: false, error: "undefined method
'must_belong_to_same_account' for an instance of
ContactCompany"}
Expected
200 on success, 422 on validation failure (e.g.
already linked, type mismatch).
Actual
500 Internal Server Error on every single request
— the whole contact_companies API is effectively
dead.
Proposed fix
Since the community edition is single-tenant, the
method is not needed. Two options:
- Remove the
validate :must_belong_to_same_account declaration
- Define the method as a no-op (keeps the code
structure for a future SaaS port)
private
def must_belong_to_same_account
# single-tenant — no-op
end
Happy to open a PR.
Version
Image evoapicloud/evo-ai-crm-community:latest as
of 2026-04-19.
The
ContactCompanymodel declaresvalidate :must_belong_to_same_accountbut the method isnever defined in the class. Any attempt to create a
contact ↔ company link crashes with
NoMethodErrorbefore the record is even saved.
Affected file
app/models/contact_company.rbReproduction
Single-tenant community install, fresh.
Or via Rails console:
Expected
200on success,422on validation failure (e.g.already linked, type mismatch).
Actual
500 Internal Server Erroron every single request— the whole
contact_companiesAPI is effectivelydead.
Proposed fix
Since the community edition is single-tenant, the
method is not needed. Two options:
validate :must_belong_to_same_accountdeclarationstructure for a future SaaS port)
Happy to open a PR.
Version
Image
evoapicloud/evo-ai-crm-community:latestasof 2026-04-19.