sequel-rails 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/History.md +5 -0
- data/lib/sequel_rails/configuration.rb +14 -16
- data/lib/sequel_rails/railtie.rb +6 -4
- data/lib/sequel_rails/version.rb +1 -1
- data/spec/lib/sequel_rails/configuration_spec.rb +4 -3
- 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: f72c17bd6336f3beaf4c924f50df1c3c5f465e26
|
4
|
+
data.tar.gz: 68c754a39afbf03af0beada56cd545c38167d59f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba99ffdebabe0e37b4d17c4de59a00bc0fba5475505d7ddd5998570fb45652f1e2f93c4597b356a798c94e1b3a174d50ac6cf7181ae506ae6d56a699b49a1449
|
7
|
+
data.tar.gz: 46740f777f70160dd7d8ffa6158557280c0677dabe0b2eae00dc7631b33b3780da148d759c9f554b0b2d9bfa90fbe56f5f07d2796f6c74a4e946f6f1bef84346
|
data/History.md
CHANGED
@@ -16,16 +16,22 @@ module SequelRails
|
|
16
16
|
class Configuration < ActiveSupport::OrderedOptions
|
17
17
|
|
18
18
|
def self.for(root, database_yml_hash)
|
19
|
-
::SequelRails.configuration ||=
|
19
|
+
::SequelRails.configuration ||= begin
|
20
|
+
config = new
|
21
|
+
config.root = root
|
22
|
+
config.raw = database_yml_hash
|
23
|
+
config
|
24
|
+
end
|
20
25
|
end
|
21
26
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
27
|
+
def initialize(*)
|
28
|
+
super
|
29
|
+
self.root = Rails.root
|
30
|
+
self.raw = nil
|
31
|
+
self.logger = Rails.logger
|
32
|
+
self.migration_dir = nil
|
33
|
+
self.schema_dump = default_schema_dump
|
34
|
+
self.load_database_tasks = true
|
29
35
|
end
|
30
36
|
|
31
37
|
def environment_for(name)
|
@@ -40,14 +46,6 @@ module SequelRails
|
|
40
46
|
end
|
41
47
|
end
|
42
48
|
|
43
|
-
def schema_dump
|
44
|
-
super.nil? ? (schema_dump = default_schema_dump) : super
|
45
|
-
end
|
46
|
-
|
47
|
-
def load_database_tasks
|
48
|
-
super.nil? ? (load_database_tasks = true) : super
|
49
|
-
end
|
50
|
-
|
51
49
|
private
|
52
50
|
|
53
51
|
def default_schema_dump
|
data/lib/sequel_rails/railtie.rb
CHANGED
@@ -34,7 +34,7 @@ module SequelRails
|
|
34
34
|
"Sequel::NoExistingObject" => :unprocessable_entity
|
35
35
|
)
|
36
36
|
|
37
|
-
config.sequel =
|
37
|
+
config.sequel = ::SequelRails::Configuration.new
|
38
38
|
|
39
39
|
rake_tasks do |app|
|
40
40
|
if app.config.sequel.load_database_tasks
|
@@ -65,9 +65,11 @@ module SequelRails
|
|
65
65
|
|
66
66
|
# Support overwriting crucial steps in subclasses
|
67
67
|
def configure_sequel(app)
|
68
|
-
app.config.sequel
|
69
|
-
::Rails.root,
|
70
|
-
|
68
|
+
app.config.sequel.merge!(
|
69
|
+
:root => ::Rails.root,
|
70
|
+
:raw => app.config.database_configuration
|
71
|
+
)
|
72
|
+
::SequelRails.configuration = app.config.sequel
|
71
73
|
end
|
72
74
|
|
73
75
|
def setup_i18n_support(app)
|
data/lib/sequel_rails/version.rb
CHANGED
@@ -39,7 +39,8 @@ describe SequelRails::Configuration do
|
|
39
39
|
let(:is_jruby) { false }
|
40
40
|
|
41
41
|
before do
|
42
|
-
SequelRails.configuration.
|
42
|
+
SequelRails.configuration = described_class.new
|
43
|
+
SequelRails.configuration.raw = environments
|
43
44
|
SequelRails.configuration.instance_variable_set('@environments', nil)
|
44
45
|
SequelRails.stub(:jruby?).and_return is_jruby
|
45
46
|
end
|
@@ -188,7 +189,7 @@ describe SequelRails::Configuration do
|
|
188
189
|
|
189
190
|
describe "#schema_dump" do
|
190
191
|
before{ Rails.stub(:env).and_return environment }
|
191
|
-
subject
|
192
|
+
subject{ described_class.new }
|
192
193
|
|
193
194
|
context "in test environment" do
|
194
195
|
let(:environment) { "test" }
|
@@ -237,7 +238,7 @@ describe SequelRails::Configuration do
|
|
237
238
|
end
|
238
239
|
|
239
240
|
describe "#load_database_tasks" do
|
240
|
-
subject
|
241
|
+
subject{ described_class.new }
|
241
242
|
|
242
243
|
it "defaults to true" do
|
243
244
|
subject.load_database_tasks.should be_true
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brasten Sager (brasten)
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-09-
|
12
|
+
date: 2013-09-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sequel
|