How can I write the following default scope:
class SimilarMerchant < ActiveRecord::Base
# relationships
belongs_to :merchant
belongs_to :similar_merchant, :foreign_key => 'similar_merchant_id', :class_name => "Merchant"
# scopes
default_scope order('merchants.is_paid DESC').order('score DESC')
end
Basically I want to sort by a merchant.is_paid
field (which belongs to a related model)
Any advice?