deals_with 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,12 +10,14 @@ module DealsWith
10
10
 
11
11
  def deals_with(model_name, options={}, &scope_proc)
12
12
  model_name = model_name.to_s.classify
13
- model_class = model_name.constantize
13
+ model_class = (model_name.constantize rescue nil)
14
14
 
15
15
  unless deals_with_models[model_name]
16
16
 
17
- model_class.reflect_on_all_associations(:belongs_to).each do |reflection|
18
- deals_with(reflection.class_name)
17
+ if model_class
18
+ model_class.reflect_on_all_associations(:belongs_to).each do |reflection|
19
+ deals_with(reflection.class_name)
20
+ end
19
21
  end
20
22
 
21
23
  deals_with_models[model_name] = DealsWith::Resource.new(self,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deals_with
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Menke
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-20 00:00:00 +02:00
12
+ date: 2009-09-10 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies: []
15
15