Sha256: cc92727ba98241655357993e41e1e0f5606ffe3ba54005d6f26ba815534645e2
Contents?: true
Size: 606 Bytes
Versions: 12
Compression:
Stored size: 606 Bytes
Contents
module Ucpengine class EntrySearchData < ActiveRecord::Base belongs_to :entry validates :entry_id, presence: true validates :attr_name, presence: true, uniqueness: { scope: :entry_id } def self.index_entry_data(entry_id, search_attributes) search_attributes.each do |attr_name, value| find_or_create_by(entry_id: entry_id, attr_name: attr_name) where(entry_id: entry_id, attr_name: attr_name).update_all([ "raw_data = :search_data, search_data = to_tsvector('english', :search_data)", search_data: value ]) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems