Skip to content
Browse files

do not use id. that apparently causes activerecord to epicly fail int…

…o an infinite loop
  • Loading branch information...
1 parent f87fb65 commit 43fcdc64e9f1790419b9a2099efb3ae80d7c63d2 Andrew Coleman committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/restricted_subdomain_model.rb
View
3 lib/restricted_subdomain_model.rb
@@ -171,7 +171,8 @@ def calculate(*args)
def with_subdomain_scope(&block)
if subdomain_klass.current
- with_scope({ :find => { :conditions => ["#{table_name}.#{subdomain_symbol}_id = ?", subdomain_klass.current.id ] } }, :merge, &block)
+ subdomain_id = subdomain_klass.current[subdomain_klass.primary_key]
+ with_scope({ :find => { :conditions => ["#{table_name}.#{subdomain_symbol}_id = ?", subdomain_id ] } }, :merge, &block)
else
with_scope({}, :merge, &block)
end

0 comments on commit 43fcdc6

Please sign in to comment.
Something went wrong with that request. Please try again.