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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c737e07b8e8d9daddeff819892c5ad278036564b
4
- data.tar.gz: 797f41088003b92ec1d44edfbcb57b2a9df18132
3
+ metadata.gz: 4bf51adfc9a18d127061688612363dee30a2a02a
4
+ data.tar.gz: f3f815ed0e9131408dc2d4af10b6c01605d14d11
5
5
  SHA512:
6
- metadata.gz: a6a58243dc89f9e5faa22a5272950bc5cf007d29a5abbbacc70fc0ec5b93aa88ecf381cbb148984067802a9141fbe78ae5f06b4d1df7a3ce33b8ee5eef351e99
7
- data.tar.gz: deca75897d21f51defb9f1ca72b610b201f2239972c6fd69b1f84792ee75229cf873ae6b617421828bf9db9fae33651806998285c54fe6cea36c2229383e9634
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
@@ -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.1
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-04-23 00:00:00.000000000 Z
12
+ date: 2014-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra