Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Do not use scrooge for inner joined queries because scrooge won't tra…
…ck other tables columns
  • Loading branch information
sdsykes committed Mar 12, 2009
1 parent 9e0c18e commit 43bdc8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/scrooge.rb
Expand Up @@ -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
Expand Down

0 comments on commit 43bdc8a

Please sign in to comment.