hammock 0.3.10.2 → 0.3.10.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.3.10.3 2009-07-20
2
+ scope_for_route considers user and public scopes when authed now.
3
+
4
+
1
5
  == 0.3.10.2 2009-07-20
2
6
  Refactored scope_for_route checks in can_verb_record? out into record_in_scope?, adding nil scope check.
3
7
 
data/hammock.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{hammock}
5
- s.version = "0.3.10.2"
5
+ s.version = "0.3.10.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Ben Hoskings"]
data/lib/hammock/scope.rb CHANGED
@@ -111,7 +111,12 @@ module Hammock
111
111
  end
112
112
 
113
113
  def scope_for_route route
114
- method_name = current_user.nil? ? :public_scope_for : :user_scope_for
114
+ (
115
+ current_user && scope_for_user_and_route(:user_scope_for, route)
116
+ ) || scope_for_user_and_route(:public_scope_for, route)
117
+ end
118
+
119
+ def scope_for_user_and_route method_name, route
115
120
  mdl.send(method_name, route.verb) || mdl.send(method_name, route.default_verb)
116
121
  end
117
122
 
data/lib/hammock.rb CHANGED
@@ -4,7 +4,7 @@ require 'ambition'
4
4
  require 'ambition/adapters/active_record'
5
5
 
6
6
  module Hammock
7
- VERSION = '0.3.10.2'
7
+ VERSION = '0.3.10.3'
8
8
  IncludeTarget = ActionController::Base
9
9
 
10
10
  def self.included base # :nodoc:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10.2
4
+ version: 0.3.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Hoskings