From b4b5b6455ce1480f7043fc2a7bcbf969f89fda9c Mon Sep 17 00:00:00 2001 From: Divan Burger Date: Tue, 30 Jan 2024 14:06:39 +0200 Subject: [PATCH] Fix foreign_key containing the namespace in the active record table backend --- lib/mobility/backends/active_record/table.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mobility/backends/active_record/table.rb b/lib/mobility/backends/active_record/table.rb index 195625a4..896c4694 100644 --- a/lib/mobility/backends/active_record/table.rb +++ b/lib/mobility/backends/active_record/table.rb @@ -102,7 +102,7 @@ class << self def configure(options) table_name = model_class.table_name options[:table_name] ||= "#{table_name.singularize}_translations" - options[:foreign_key] ||= table_name.downcase.singularize.camelize.foreign_key + options[:foreign_key] ||= table_name.classify.foreign_key if (association_name = options[:association_name]).present? options[:subclass_name] ||= association_name.to_s.singularize.camelize.freeze else