Module: ActiveRecord::SessionStore::ClassMethods
Overview
Defined Under Namespace
Classes: HybridSerializer, JsonSerializer, MarshalSerializer, NullSerializer
Instance Method Summary
collapse
Instance Method Details
#create_table! ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/active_record/session_store.rb', line 29
def create_table!
if connection.schema_cache.respond_to?(:clear_data_source_cache!)
connection.schema_cache.clear_data_source_cache!(table_name)
else
connection.schema_cache.clear_table_cache!(table_name)
end
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
|
#deserialize(data) ⇒ Object
16
17
18
|
# File 'lib/active_record/session_store.rb', line 16
def deserialize(data)
serializer_class.load(data) if data
end
|
#drop_table! ⇒ Object
20
21
22
23
24
25
26
27
|
# File 'lib/active_record/session_store.rb', line 20
def drop_table!
if connection.schema_cache.respond_to?(:clear_data_source_cache!)
connection.schema_cache.clear_data_source_cache!(table_name)
else
connection.schema_cache.clear_table_cache!(table_name)
end
connection.drop_table table_name
end
|
#serialize(data) ⇒ Object
12
13
14
|
# File 'lib/active_record/session_store.rb', line 12
def serialize(data)
serializer_class.dump(data) if data
end
|
#serializer_class ⇒ Object