Sha256: 7264ac3e3a8e41adda219341960847c112b11bced49d24a381eba186ac7d4d6b

Contents?: true

Size: 814 Bytes

Versions: 2

Compression:

Stored size: 814 Bytes

Contents

class User < ActiveRecord::Base
  has_one   :specific_seller, :class_name => "Seller"
  has_one   :address, :class_name => "Geo::Address"

  is_indexed :fields => ['login', 'email', 'deleted'], 
    :include => [{:association_name => 'specific_seller', :field => 'company_name', :as => 'company', :facet => true},
      {:class_name => 'Seller', :field => 'sellers_two.company_name', :as => 'company_two', :facet => true, 'association_sql' => 'LEFT OUTER JOIN sellers AS sellers_two ON users.id = sellers_two.user_id', 'function_sql' => "REPLACE(?, '6', ' replacement ')"}],
    :conditions => "deleted = '0'",
    :delta => {:field => 'created_at'}    
  
  def self.find_all_by_id(*args)
    raise "Wrong finder"
  end
    
  def self.custom_find(*args)
    method_missing(:find_all_by_id, *args)
  end  
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ultrasphinx-1.11 test/integration/app/app/models/person/user.rb
ultrasphinx-1.9 test/integration/app/app/models/person/user.rb