lib/personal.rb in personal-0.2.0 vs lib/personal.rb in personal-0.3.0
- old
+ new
@@ -58,9 +58,13 @@
def latest_entries(limit = 10)
@db.execute("select * from (select * from personal order by created_at desc limit ?) order by created_at ASC", limit)
end
+ def find(some_text)
+ @db.execute("select * from (select * from personal where data like ? order by created_at desc) order by created_at ASC", "%" + some_text + "%")
+ end
+
def entries_by_year_and_month(year, month)
@db.execute("select * from (select * from personal where cast(strftime('%Y', created_at) as integer) = ? and cast(strftime('%m', created_at) as integer) = ? order by created_at DESC) order by created_at ASC", year, month)
end
def entries_by_year_month_day(year, month, day)