Displaying 1 result from an estimated 1 matches for "find_by_setting".
2005 Dec 08
2
Confusing lock problem in rails
...c[:contents].downcase.index(query)
ind = (ind > 20) ? (ind - 20) : 0
doc[:teaser] = doc[:contents][ind..(ind + 220)]
docs << doc
end
[count, docs]
end
def mark_as_viewed(user_id)
# user = self.users.find(user_id)
end
def self.delete_old
@p = Pref.find_by_setting(''autodelete'')
if @p and @p.value.to_i > 0
val = @p.value.to_i
destroy_all(["found_on <= DATE_SUB(CURDATE(), INTERVAL ? DAY)", val])
end
end
def self.delete_before(params)
date = sprintf("%04d-%02d-%02d", params[:foundon][:year...