sinatra-activerecord 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -0
- data/lib/sinatra/activerecord.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bf51adfc9a18d127061688612363dee30a2a02a
|
4
|
+
data.tar.gz: f3f815ed0e9131408dc2d4af10b6c01605d14d11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b034a7c84c57ec640fe838fbfe76e71fc48e566b1b1d8ed914a2cfa0579c293115e0a83d072d24fb07ad8f2039fe629567a73a81c8d4b3b59176c0e7ad9d059c
|
7
|
+
data.tar.gz: 663df2a5530b01d4ea24a72f7d5e8f64be8dd0e70d1d186a023c2e4db5f0d8b23efd2dc817236abed20dda5f86b8c76d7b86392a64594515c37f999e9215502c
|
data/README.md
CHANGED
@@ -47,6 +47,20 @@ require "sinatra/activerecord/rake"
|
|
47
47
|
require "./app"
|
48
48
|
```
|
49
49
|
|
50
|
+
In case you're using tools like SimpleCov, where the application needs to be
|
51
|
+
required only inside SimpleCov's Rake tasks, you can do
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
# Rakefile
|
55
|
+
require "sinatra/activerecord/rake"
|
56
|
+
|
57
|
+
namespace :db do
|
58
|
+
task :load_config do
|
59
|
+
require "./app"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
```
|
63
|
+
|
50
64
|
In the Terminal test that it works:
|
51
65
|
|
52
66
|
```sh
|
data/lib/sinatra/activerecord.rb
CHANGED
@@ -34,9 +34,9 @@ module Sinatra
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def database=(spec)
|
37
|
-
if spec.is_a?(Hash) and spec.symbolize_keys[environment]
|
37
|
+
if spec.is_a?(Hash) and spec.symbolize_keys[environment.to_sym]
|
38
38
|
ActiveRecord::Base.configurations = spec.stringify_keys
|
39
|
-
ActiveRecord::Base.establish_connection(environment)
|
39
|
+
ActiveRecord::Base.establish_connection(environment.to_sym)
|
40
40
|
else
|
41
41
|
ActiveRecord::Base.establish_connection(spec)
|
42
42
|
ActiveRecord::Base.configurations = {
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Mizerany
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|