deals_with 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/deals_with/resource.rb +3 -3
  2. metadata +3 -3
@@ -26,7 +26,7 @@ module DealsWith
26
26
 
27
27
  def parents
28
28
  @parents ||= model_class.reflect_on_all_associations(:belongs_to).collect do |reflection|
29
- if reflection.klass.instance_methods.include? model_name.tableize
29
+ if reflection.klass.instance_methods.include? model_name.gsub(/.+[:]{2}/, '').tableize
30
30
  controller_class.deals_with_models[reflection.class_name]
31
31
  end
32
32
  end.compact
@@ -40,11 +40,11 @@ module DealsWith
40
40
  base = nil
41
41
  parents.each do |resource|
42
42
  if resource.can_find?(controller)
43
- base = controller.send(resource.model_name.underscore)
43
+ base = controller.send(resource.model_name.gsub(/.+[:]{2}/, '').underscore)
44
44
  break
45
45
  end
46
46
  end
47
- base = base.send(model_name.tableize) if base
47
+ base = base.send(model_name.gsub(/.+[:]{2}/, '').tableize) if base
48
48
  base ||= model_class
49
49
  base = @scope_proc.call(base) if @scope_proc
50
50
  base
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.2
4
+ version: 0.0.3
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-06-22 00:00:00 +02:00
12
+ date: 2009-08-20 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  requirements: []
57
57
 
58
58
  rubyforge_project:
59
- rubygems_version: 1.3.3
59
+ rubygems_version: 1.3.5
60
60
  signing_key:
61
61
  specification_version: 3
62
62
  summary: Automaticaly find any appropriately scoped resources.