def self.search(search, page)
paginate_by_sql ['SELECT FROM posts WHERE #{time_difference created_at}
<= #{search}'], :per_page => 15, :page => page
end
I need something to this extent, where time_difference is a helper
method, created_at is the timestamp field for an activerecord object,
and search is a parameter passed into my self.search method.
def self.search(search, page)
paginate_by_sql ['SELECT FROM posts WHERE #{time_difference created_at}
<= #{search}'], :per_page => 15, :page => page
end
I need something to this extent, where time_difference is a helper
method, created_at is the timestamp field for an activerecord object,
and search is a parameter passed into my self.search method.
Correction, paginate_by_sql ['SELECT FROM posts WHERE
#{Time.now.minus_with_coercion created_at} <= #{search}']