Skip to content

Commit

Permalink
Better support for String primary keys
Browse files Browse the repository at this point in the history
Belongs to #60
  • Loading branch information
ledermann committed Sep 3, 2015
1 parent 0bfcb4f commit 01f9104
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/unread/readable_scopes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def join_read_marks(user)
joins "LEFT JOIN read_marks
ON read_marks.readable_type = '#{base_class.name}'
AND read_marks.readable_id = #{quoted_table_name}.#{quoted_primary_key}
AND read_marks.user_id = #{user.id}
AND read_marks.user_id = #{quote_bound_value(user.id)}
AND read_marks.timestamp >= #{quoted_table_name}.#{connection.quote_column_name(readable_options[:on])}"
end

Expand Down Expand Up @@ -40,7 +40,7 @@ def read_by(user)
def with_read_marks_for(user)
join_read_marks(user).select("#{quoted_table_name}.*,
read_marks.id AS read_mark_id,
#{user.id} AS read_mark_user_id")
#{quote_bound_value user.id} AS read_mark_user_id")
end
end
end
Expand Down

0 comments on commit 01f9104

Please sign in to comment.