sinatra-activerecord 2.0.26 → 2.0.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sinatra/activerecord/rake/activerecord_8.rb +23 -0
- data/lib/sinatra/activerecord.rb +12 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2a5b91b9bc498894eb844fbd5f13bdc9431ac6d1df8b6ddd6cc2c210415ece8
|
4
|
+
data.tar.gz: b476e1a91a1a3bc50e8f5cf25d96d367e107aafaa6854e8ec689b672b79e599f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fbf2d90255d298414ea40b0c2fce51278ec1a0c0af51a52464691bd83ca80e281476edb01368b321448bcc5b09cdbbdb94206466c5fc793f82e59f061297153
|
7
|
+
data.tar.gz: 2997ed845b00645fa05704e5d86bc2abe3dc216037b8e37cbbcf9cae48aa0ee27138aac29af90a3c6c31c572f93a3dc7055b2d5624ea0bfcec277e6e63f07bdd
|
@@ -0,0 +1,23 @@
|
|
1
|
+
seed_loader = Class.new do
|
2
|
+
def load_seed
|
3
|
+
load "#{ActiveRecord::Tasks::DatabaseTasks.db_dir}/seeds.rb"
|
4
|
+
end
|
5
|
+
end
|
6
|
+
|
7
|
+
ActiveRecord::Tasks::DatabaseTasks.tap do |config|
|
8
|
+
config.root = Rake.application.original_dir
|
9
|
+
config.env = ENV["APP_ENV"] || ENV["RACK_ENV"] || "development"
|
10
|
+
config.db_dir = "db"
|
11
|
+
config.migrations_paths = ["db/migrate"]
|
12
|
+
config.fixtures_path = "test/fixtures"
|
13
|
+
config.seed_loader = seed_loader.new
|
14
|
+
config.database_configuration = ActiveRecord::Base.configurations
|
15
|
+
end
|
16
|
+
|
17
|
+
# db:load_config can be overriden manually
|
18
|
+
Rake::Task["db:seed"].enhance(["db:load_config"])
|
19
|
+
Rake::Task["db:load_config"].clear
|
20
|
+
|
21
|
+
# define Rails' tasks as no-op
|
22
|
+
Rake::Task.define_task("db:environment")
|
23
|
+
Rake::Task["db:test:deprecated"].clear if Rake::Task.task_defined?("db:test:deprecated")
|
data/lib/sinatra/activerecord.rb
CHANGED
@@ -59,8 +59,18 @@ module Sinatra
|
|
59
59
|
app.helpers ActiveRecordHelper
|
60
60
|
|
61
61
|
# re-connect if database connection dropped (Rails 3 only)
|
62
|
-
app.before
|
63
|
-
|
62
|
+
app.before do
|
63
|
+
if ActiveRecord::VERSION::MAJOR == 3
|
64
|
+
ActiveRecord::Base.verify_active_connections! if ActiveRecord::Base.respond_to?(:verify_active_connections!)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
app.after do
|
68
|
+
if ActiveRecord::VERSION::MAJOR < 7
|
69
|
+
ActiveRecord::Base.clear_active_connections!
|
70
|
+
else
|
71
|
+
ActiveRecord::Base.connection_handler.clear_active_connections!
|
72
|
+
end
|
73
|
+
end
|
64
74
|
end
|
65
75
|
|
66
76
|
def database_file=(path)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Mizerany
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-11-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: sinatra
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- lib/sinatra/activerecord/rake/activerecord_5.rb
|
112
112
|
- lib/sinatra/activerecord/rake/activerecord_6.rb
|
113
113
|
- lib/sinatra/activerecord/rake/activerecord_7.rb
|
114
|
+
- lib/sinatra/activerecord/rake/activerecord_8.rb
|
114
115
|
- lib/sinatra/activerecord/tasks.rake
|
115
116
|
homepage: http://github.com/sinatra-activerecord/sinatra-activerecord
|
116
117
|
licenses:
|
@@ -131,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
132
|
- !ruby/object:Gem::Version
|
132
133
|
version: '0'
|
133
134
|
requirements: []
|
134
|
-
rubygems_version: 3.
|
135
|
+
rubygems_version: 3.3.7
|
135
136
|
signing_key:
|
136
137
|
specification_version: 4
|
137
138
|
summary: Extends Sinatra with ActiveRecord helpers.
|