I'm having trouble deleting records from the active repository.
I want to delete based on session data:
ActiveRecord::SessionStore::Session.find(:all).each do |s| if s.data[:userid] == 1234 s.destroy end end
doesn't seem to work, but:
ActiveRecord::SessionStore::Session.delete_all(["updated_at < ?", 12.hours.ago])
seems to work and:
ActiveRecord::SessionStore::Session.find(:all).each do |s| if s.data[:userid] == 1234 ActiveRecord::SessionStore::Session.delete_all("session_id = ?", s.session_id) end end
also does not work.
I am running rails 2.3.2, ruby 1.8.7.
source share