Module: ActiveRecord::SessionStore::ClassMethods

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#create_table!Object



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

def create_table!
  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
# File 'lib/active_record/session_store.rb', line 61

def drop_table!
  connection.drop_table table_name
end

#marshal(data) ⇒ Object



53
54
55
# File '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 'lib/active_record/session_store.rb', line 57

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