mongomodel 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mongomodel/railtie.rb +11 -1
- data/lib/mongomodel/version.rb +1 -1
- metadata +4 -4
data/lib/mongomodel/railtie.rb
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
module MongoModel
|
2
2
|
class Railtie < Rails::Railtie
|
3
|
+
def self.rescue_responses
|
4
|
+
{ 'MongoModel::DocumentNotFound' => :not_found }
|
5
|
+
end
|
6
|
+
|
7
|
+
if config.action_dispatch.rescue_responses
|
8
|
+
config.action_dispatch.rescue_responses.merge!(rescue_responses)
|
9
|
+
end
|
10
|
+
|
3
11
|
config.app_generators.orm :mongo_model, :migration => false
|
4
12
|
|
5
13
|
rake_tasks do
|
@@ -15,7 +23,9 @@ module MongoModel
|
|
15
23
|
end
|
16
24
|
|
17
25
|
initializer "mongomodel.rescue_responses" do
|
18
|
-
|
26
|
+
unless config.action_dispatch.rescue_responses
|
27
|
+
ActionDispatch::ShowExceptions.rescue_responses.update(self.class.rescue_responses)
|
28
|
+
end
|
19
29
|
end
|
20
30
|
|
21
31
|
initializer "mongomodel.database_configuration" do |app|
|
data/lib/mongomodel/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongomodel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 5
|
10
|
+
version: 0.4.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sam Pohlenz
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-02-20 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
prerelease: false
|