Module: ActiveRecord::SessionStore::ClassMethods

Included in:
Session, SqlBypass
Defined in:
activerecord/lib/active_record/session_store.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#create_table!Object



66
67
68
69
70
71
72
73
# File 'activerecord/lib/active_record/session_store.rb', line 66

def create_table!
  connection_pool.clear_table_cache!(table_name)
  connection.create_table(table_name) do |t|
    t.string session_id_column, :limit => 255
    t.text data_column_name
  end
  connection.add_index table_name, session_id_column, :unique => true
end

#drop_table!Object



61
62
63
64
# File 'activerecord/lib/active_record/session_store.rb', line 61

def drop_table!
  connection_pool.clear_table_cache!(table_name)
  connection.drop_table table_name
end

#marshal(data) ⇒ Object



53
54
55
# File 'activerecord/lib/active_record/session_store.rb', line 53

def marshal(data)
  ActiveSupport::Base64.encode64(Marshal.dump(data)) if data
end

#unmarshal(data) ⇒ Object



57
58
59
# File 'activerecord/lib/active_record/session_store.rb', line 57

def unmarshal(data)
  Marshal.load(ActiveSupport::Base64.decode64(data)) if data
end