diff --git a/lib/deep_cloneable.rb b/lib/deep_cloneable.rb
index <HASH>..<HASH> 100644
--- a/lib/deep_cloneable.rb
+++ b/lib/deep_cloneable.rb
@@ -80,7 +80,7 @@ class ActiveRecord::Base
               if association_reflection.options[:as]
                 fk = association_reflection.options[:as].to_s + "_id"
               else
-                fk = association_reflection.options[:foreign_key] || self.class.to_s.underscore + "_id"
+                fk = association_reflection.options[:foreign_key] || self.class.to_s.underscore.sub(/([^\/]*\/)*/, '') + "_id"
               end
               self.send(association).collect do |obj| 
                 tmp = obj.clone(opts)
fix one bug:
when model has namespace, like class is Aaa::Bbb, then it will be raise a undefined method error "can't find aaa/bbb_id", generally, the foreign key
will be bbb_id for aaa object, this is a common case.