Created
January 4, 2011 10:15
-
-
Save hemju/764613 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Book < ActiveRecord::Base | |
belongs_to :auther | |
searchable do | |
text :title, :default_boost => 2 | |
text :description | |
time :updated_at # for sorting by recent | |
integer :auther_id, :multi => true do | |
authers.map {|auther| auther.auther_id} | |
end | |
boolean :published, :using => :published? | |
end | |
def published? | |
state == :published | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment