Class: ActiveRecord::SessionStore::Session
- Extended by:
- ClassMethods
- Defined in:
- activerecord/lib/active_record/session_store.rb
Overview
The default Active Record class.
Constant Summary
Constants included from AutosaveAssociation
AutosaveAssociation::ASSOCIATION_TYPES
Constants included from Callbacks
Constants included from ActiveModel::AttributeMethods
ActiveModel::AttributeMethods::CALL_COMPILABLE_REGEXP, ActiveModel::AttributeMethods::NAME_COMPILABLE_REGEXP
Instance Attribute Summary collapse
-
#data ⇒ Object
Lazy-unmarshal session state.
Attributes included from Associations
Class Method Summary collapse
- .data_column_size_limit ⇒ Object
-
.find_by_session_id(session_id) ⇒ Object
Hook to set up sessid compatibility.
Instance Method Summary collapse
-
#data_column_name ⇒ Object
:singleton-method: Customizable data column name.
-
#initialize(attributes = nil, options = {}) ⇒ Session
constructor
A new instance of Session.
-
#loaded? ⇒ Boolean
Has the session been loaded yet?.
Methods included from ClassMethods
create_table!, drop_table!, marshal, unmarshal
Methods inherited from Base
#<=>, #==, ===, arel_engine, arel_table, clear_active_connections!, #configurations, connected?, #connection, connection, connection_config, #connection_handler, connection_id, connection_id=, connection_pool, #default_timezone, #dup, #encode_with, establish_connection, #freeze, #frozen?, generated_feature_methods, #hash, inherited, #init_with, #initialize_dup, initialize_generated_modules, #inspect, inspect, #logger, mysql2_connection, mysql_connection, postgresql_connection, #readonly!, #readonly?, remove_connection, retrieve_connection, #schema_format, sqlite3_connection, #timestamped_migrations, #to_yaml, #yaml_initialize
Methods included from Explain
#collecting_queries_for_explain, #exec_explain, extended, #logging_query_plan, #silence_auto_explain
Methods included from CounterCache
#decrement_counter, #increment_counter, #reset_counters, #update_counters
Methods included from DynamicMatchers
Methods included from Translation
#i18n_scope, #lookup_ancestors
Methods included from ActiveModel::Translation
#human_attribute_name, #i18n_scope, #lookup_ancestors
Methods included from ActiveModel::Naming
#model_name, param_key, plural, route_key, singular, singular_route_key, uncountable?
Methods included from Querying
Methods included from ActiveSupport::DescendantsTracker
clear, descendants, #descendants, #direct_descendants, direct_descendants, #inherited
Methods included from ActiveSupport::Benchmarkable
Methods included from QueryCache::ClassMethods
Methods included from Aggregations
Methods included from ActiveSupport::Concern
#append_features, extended, #included
Methods included from Transactions
#add_to_transaction, #committed!, #destroy, #rollback_active_record_state!, #rolledback!, #save, #save!, #transaction, #with_transaction_returning_status
Methods included from ActiveRecord::Serialization
Methods included from ActiveModel::Serializers::Xml
Methods included from ActiveModel::Serialization
Methods included from ActiveModel::Serializers::JSON
Methods included from AutosaveAssociation
#changed_for_autosave?, #mark_for_destruction, #marked_for_destruction?, #reload
Methods included from NestedAttributes
Methods included from IdentityMap
add, clear, enabled, enabled=, get, #reinit_with, remove, remove_by_id, repository, use, without
Methods included from Associations
#association, #clear_association_cache
Methods included from Callbacks
Methods included from Timestamp
Methods included from AttributeMethods
#attribute_for_inspect, #attribute_missing, #attribute_names, #attribute_present?, #attributes, #column_for_attribute, #has_attribute?, #method_missing, #respond_to?
Methods included from ActiveSupport::Autoload
#autoload, #autoload_at, #autoload_under, #autoloads, #eager_autoload, eager_autoload!
Methods included from ActiveModel::AttributeMethods
#attribute_missing, #method_missing, #respond_to?, #respond_to_without_attributes?
Methods included from Locking::Optimistic
Methods included from Locking::Pessimistic
Methods included from Validations
Methods included from ActiveModel::Validations
#dup, #errors, #initialize_dup, #invalid?, #valid?, #validates_with
Methods included from ActiveSupport::Callbacks
Methods included from Integration
Methods included from ActiveModel::Conversion
#to_key, #to_model, #to_param, #to_partial_path
Methods included from AttributeAssignment
#assign_attributes, #attributes=
Methods included from ActiveRecord::Sanitization
Methods included from ActiveRecord::Scoping
#populate_with_current_scope_attributes
Methods included from Persistence
#becomes, #decrement, #decrement!, #delete, #destroy, #destroyed?, #increment, #increment!, #new_record?, #persisted?, #reload, #save, #save!, #toggle, #toggle!, #touch, #update_attribute, #update_attributes, #update_attributes!, #update_column
Constructor Details
#initialize(attributes = nil, options = {}) ⇒ Session
Returns a new instance of Session.
130 131 132 133 |
# File 'activerecord/lib/active_record/session_store.rb', line 130 def initialize(attributes = nil, = {}) @data = nil super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveRecord::AttributeMethods
Instance Attribute Details
#data ⇒ Object
Lazy-unmarshal session state.
136 137 138 |
# File 'activerecord/lib/active_record/session_store.rb', line 136 def data @data ||= self.class.unmarshal(read_attribute(@@data_column_name)) || {} end |
Class Method Details
.data_column_size_limit ⇒ Object
94 95 96 |
# File 'activerecord/lib/active_record/session_store.rb', line 94 def data_column_size_limit @data_column_size_limit ||= columns_hash[data_column_name].limit end |
.find_by_session_id(session_id) ⇒ Object
Hook to set up sessid compatibility.
99 100 101 102 |
# File 'activerecord/lib/active_record/session_store.rb', line 99 def find_by_session_id(session_id) setup_sessid_compatibility! find_by_session_id(session_id) end |
Instance Method Details
#data_column_name ⇒ Object
:singleton-method: Customizable data column name. Defaults to ‘data’.
85 |
# File 'activerecord/lib/active_record/session_store.rb', line 85 cattr_accessor :data_column_name |
#loaded? ⇒ Boolean
Has the session been loaded yet?
143 144 145 |
# File 'activerecord/lib/active_record/session_store.rb', line 143 def loaded? @data end |