couchrest_model_config 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v0.1.3
2
+ -- simpler method for fixing rails reloading problem now in a railtie.
3
+
1
4
  v0.1.2
2
5
  -- CouchRest inheritable attribute override gone. simpler method for fixing rails reloading problem.
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -3,3 +3,4 @@ require 'couchrest_model_config/config'
3
3
  require 'couchrest_model_config/model'
4
4
  require 'couchrest_model_config/server'
5
5
  require 'couchrest_model_config/couchrest_model_base.rb'
6
+ require 'couchrest_model_config/railtie' if defined?(Rails)
@@ -0,0 +1,31 @@
1
+ module CouchRest
2
+ module Model
3
+ module Config
4
+ class Railtie < ::Rails::Railtie
5
+ config.to_prepare do
6
+ module ::CouchRest
7
+ module Model
8
+ class Base
9
+ class_eval <<-EOS, __FILE__, __LINE__ + 1
10
+ def self.database
11
+ CouchRest::Model::Config.for(self).current_database
12
+ end
13
+
14
+ def database
15
+ CouchRest::Model::Config.for(self.class).current_database
16
+ end
17
+ EOS
18
+
19
+ class << self
20
+ def use_database(*args)
21
+ raise "We're sorry, but the `use_database` method is not supported with couchrest_model_config."
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchrest_model_config
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Parker
@@ -97,6 +97,7 @@ files:
97
97
  - lib/couchrest_model_config/config.rb
98
98
  - lib/couchrest_model_config/couchrest_model_base.rb
99
99
  - lib/couchrest_model_config/model.rb
100
+ - lib/couchrest_model_config/railtie.rb
100
101
  - lib/couchrest_model_config/server.rb
101
102
  - readme.markdown
102
103
  has_rdoc: true