activerecord-session_store 1.1.1 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activerecord-session_store might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69ef2fc8f7b887d468429b3649f00916007a913d805bbd3f1df1631a37e69944
4
- data.tar.gz: 82a554f1d27375976f2c4cfc27bb02c42ff798250d8e1b57446a0a3cf099f2b8
3
+ metadata.gz: af08a0134b3e5a615c2d9f400c30c9d0b4f5327e21c1254f49cfec775ef73732
4
+ data.tar.gz: f6dd6871a3df37d22cc652b54b3f76f41746d9f0c5e01920984a3bcc6d516cf6
5
5
  SHA512:
6
- metadata.gz: 7bde42c0fce200c98e80adfc855bf1f4ca9b91b6990aa1e988917c9998c3822fff14b52a3a8f41b444eec9bd8b2c5a85e729ab7dcb050d1ace893b87df68b2fe
7
- data.tar.gz: 3094effc2159cafd363cf085e670d3f09cd33f8a90d994ce4717be1c6ed8a06319717b6d2785ee30630df20413ac35b13e43a0a419485a65b41dca69474aced8
6
+ metadata.gz: 300394f621b26e545ba842e3d8c4a78f733cd34768ede33ab07f7f4abfc168fc1fa60c4b10ea47a7046db896395206201e3a0b0aa1680418bd219998ebbd5b46
7
+ data.tar.gz: f4fd30af09711cc74e0a7365c6c529c99a1cd47a4aa91f8c0314deb4eb0cd552d8b3824e497e5d9af86ac110c98f3b9d5865b771af1db12993401774bdfd7422
@@ -98,7 +98,7 @@ module ActionDispatch
98
98
  def delete_session(request, session_id, options)
99
99
  logger.silence_logger do
100
100
  if sid = current_session_id(request)
101
- if model = get_session_model(request, sid)
101
+ if model = @@session_class.find_by_session_id(sid)
102
102
  data = model.data
103
103
  model.destroy
104
104
  end
@@ -103,3 +103,5 @@ module ActiveRecord
103
103
  end
104
104
  end
105
105
  end
106
+
107
+ ActionDispatch::Session::ActiveRecordStore.session_class = ActiveRecord::SessionStore::Session
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module SessionStore
3
- VERSION = '1.1.1'
3
+ VERSION = "1.1.3".freeze
4
4
  end
5
5
  end
@@ -1,3 +1,4 @@
1
+ require 'active_record'
1
2
  require 'active_record/session_store/version'
2
3
  require 'action_dispatch/session/active_record_store'
3
4
  require "active_record/session_store/extension/logger_silencer"
@@ -6,6 +7,8 @@ require 'multi_json'
6
7
 
7
8
  module ActiveRecord
8
9
  module SessionStore
10
+ autoload :Session, 'active_record/session_store/session'
11
+
9
12
  module ClassMethods # :nodoc:
10
13
  mattr_accessor :serializer
11
14
 
@@ -108,11 +111,13 @@ module ActiveRecord
108
111
  end
109
112
  end
110
113
 
111
- require 'active_record/session_store/session'
114
+ ActiveSupport.on_load(:active_record) do
115
+ require 'active_record/session_store/session'
116
+ end
117
+
112
118
  require 'active_record/session_store/sql_bypass'
113
119
  require 'active_record/session_store/railtie' if defined?(Rails)
114
120
 
115
- ActionDispatch::Session::ActiveRecordStore.session_class = ActiveRecord::SessionStore::Session
116
121
  Logger.send :include, ActiveRecord::SessionStore::Extension::LoggerSilencer
117
122
 
118
123
  begin
@@ -19,6 +19,10 @@ module ActiveRecord
19
19
  end
20
20
  current_table_name
21
21
  end
22
+
23
+ def migration_version
24
+ "[#{ActiveRecord::Migration.current_version}]" if ActiveRecord::Migration.respond_to?(:current_version)
25
+ end
22
26
  end
23
27
  end
24
28
  end
@@ -1,4 +1,4 @@
1
- class <%= migration_class_name %> < ActiveRecord::Migration
1
+ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :<%= session_table_name %> do |t|
4
4
  t.string :session_id, :null => false
@@ -1,7 +1,6 @@
1
1
  namespace 'db:sessions' do
2
2
  desc "Creates a sessions migration for use with ActiveRecord::SessionStore"
3
3
  task :create => [:environment, 'db:load_config'] do
4
- raise 'Task unavailable to this database (no migration support)' unless ActiveRecord::Base.connection.supports_migrations?
5
4
  Rails.application.load_generators
6
5
  require 'generators/active_record/session_migration_generator'
7
6
  ActiveRecord::Generators::SessionMigrationGenerator.start [ ENV['MIGRATION'] || 'add_sessions_table' ]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-session_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-12 00:00:00.000000000 Z
11
+ date: 2019-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -106,20 +106,6 @@ dependencies:
106
106
  - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
- - !ruby/object:Gem::Dependency
110
- name: appraisal
111
- requirement: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - "~>"
114
- - !ruby/object:Gem::Version
115
- version: 2.1.0
116
- type: :development
117
- prerelease: false
118
- version_requirements: !ruby/object:Gem::Requirement
119
- requirements:
120
- - - "~>"
121
- - !ruby/object:Gem::Version
122
- version: 2.1.0
123
109
  description:
124
110
  email: david@loudthinking.com
125
111
  executables: []
@@ -162,8 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
148
  - !ruby/object:Gem::Version
163
149
  version: '0'
164
150
  requirements: []
165
- rubyforge_project:
166
- rubygems_version: 2.7.3
151
+ rubygems_version: 3.0.3
167
152
  signing_key:
168
153
  specification_version: 4
169
154
  summary: An Action Dispatch session store backed by an Active Record class.