Skip to content

Commit

Permalink
Look in base table before looking in slug table for slugged model
Browse files Browse the repository at this point in the history
  • Loading branch information
jgadbois committed Dec 30, 2013
1 parent 11d530a commit 36cd068
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/friendly_id/history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def exists_by_friendly_id?(id)
private

def first_by_friendly_id(id)
where(friendly_id_config.query_field => id).first ||
select(quoted_table_name + '.*').joins(:slugs).where(slug_history_clause(id)).first
end

Expand Down

0 comments on commit 36cd068

Please sign in to comment.