resource_awareness 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  require 'action_controller/base'
2
2
 
3
3
  class ActionController::Base
4
- def resource
5
- @resource ||= Rails.application.resources.find { |r| r.controller_path == self.controller_path }
4
+ def resource_definition
5
+ @resource_definition ||= Rails.application.resource_definitions.find { |r| r.controller_path == self.controller_path }
6
6
  end
7
7
  end
@@ -3,8 +3,8 @@ require 'resource_awareness/resource_collection'
3
3
 
4
4
  module ResourceAwareness
5
5
  module ApplicationExtensions
6
- def resources
7
- @resources ||= ResourceCollection.new
6
+ def resource_definitions
7
+ @resource_definitions ||= ResourceCollection.new
8
8
  end
9
9
  end
10
10
  end
@@ -7,13 +7,13 @@ module ResourceAwareness
7
7
  def resources(*entities, &block)
8
8
  super
9
9
  options = entities.extract_options!
10
- Rails.application.resources << Rails::Resource.new(entities.first, @scope, options) if leaf_call?(entities, options)
10
+ Rails.application.resource_definitions << Rails::Resource.new(entities.first, @scope, options) if leaf_call?(entities, options)
11
11
  end
12
12
 
13
13
  def resource(*entities, &block)
14
14
  super
15
15
  options = entities.extract_options!
16
- Rails.application.resources << Rails::SingletonResource.new(entities.first, @scope, options) if leaf_call?(entities, options)
16
+ Rails.application.resource_definitions << Rails::SingletonResource.new(entities.first, @scope, options) if leaf_call?(entities, options)
17
17
  end
18
18
 
19
19
  private
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
8
- - 1
9
- version: 0.1.1
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ingo Weiss
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-09 00:00:00 +02:00
17
+ date: 2010-06-21 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency