search: refactor parse_query and build methods.
* Eliminate the `parse_query` method. * Move all the metatag handling logic from the `build` method to `metatag_matches` and helper methods. This is to get all the main metatag handling logic in one place, inside `metatag_matches`, so that it's easier to add new metatags and to handle things like negated metatags more consistently.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@ class Favorite < ApplicationRecord
|
||||
belongs_to :post
|
||||
belongs_to :user
|
||||
|
||||
scope :for_user, ->(user_id) {where("user_id % 100 = #{user_id.to_i % 100} and user_id = #{user_id.to_i}")}
|
||||
scope :for_user, ->(user_id) { where("favorites.user_id % 100 = ? AND favorites.user_id = ?", user_id.to_i % 100, user_id) }
|
||||
scope :public_favorites, -> { where(user: User.bit_prefs_match(:enable_private_favorites, false)) }
|
||||
|
||||
def self.visible(user)
|
||||
|
||||
Reference in New Issue
Block a user