forked from saurabh/personal-book
Fix bug.
This commit is contained in:
parent
8f6a823516
commit
d54176b635
|
@ -40,7 +40,7 @@ class Book
|
||||||
before_validation :add_http
|
before_validation :add_http
|
||||||
|
|
||||||
index({year: -1, :publish_date => -1, :publication_date => -1, _id: -1}, { unique: false, background: false })
|
index({year: -1, :publish_date => -1, :publication_date => -1, _id: -1}, { unique: false, background: false })
|
||||||
scope :sort_year_date, ->{ order_by(:year => "desc", :publish_date => "desc", :publication_date => "desc", :id => "desc")) }
|
scope :sort_year_date, ->{ order_by(:year => "desc", :publish_date => "desc", :publication_date => "desc", :id => "desc") }
|
||||||
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc", :publish_date => "desc", :publication_date => "desc", :id => "desc") }
|
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc", :publish_date => "desc", :publication_date => "desc", :id => "desc") }
|
||||||
def book_paper_type
|
def book_paper_type
|
||||||
self.book_type.title rescue ""
|
self.book_type.title rescue ""
|
||||||
|
|
Loading…
Reference in New Issue