Skip to content

Commit

Permalink
Merge pull request #509 from jgadbois/master
Browse files Browse the repository at this point in the history
Look in base table before looking in slug table for slugged model
  • Loading branch information
norman committed Feb 14, 2014
2 parents f0128e7 + 36cd068 commit b5f3910
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 b5f3910

Please sign in to comment.