diff --git a/lib/scrooge.rb b/lib/scrooge.rb index 8490fce..dcb9c76 100644 --- a/lib/scrooge.rb +++ b/lib/scrooge.rb @@ -134,7 +134,8 @@ def find_by_sql(sql) # Only scope n-1 rows by default. # Stephen: Temp. relaxed the LIMIT constraint - please advise. def scope_with_scrooge?( sql ) - sql =~ scrooge_select_regex && column_names.include?(self.primary_key.to_s) #&& sql !~ /LIMIT 1$/ + sql =~ scrooge_select_regex && column_names.include?(self.primary_key.to_s) && + sql !~ /INNER JOIN/ #&& sql !~ /LIMIT 1$/ end # Populate the storage for a given callsite signature