Skip to content

Instantly share code, notes, and snippets.

@matflores
Created January 29, 2010 20:13
Show Gist options
  • Save matflores/290070 to your computer and use it in GitHub Desktop.
Save matflores/290070 to your computer and use it in GitHub Desktop.
From 148b0afa9c8decdf24e859393277d5ed56bf1e49 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Mat=C3=ADas=20Flores?= <[email protected]>
Date: Fri, 29 Jan 2010 17:01:39 -0300
Subject: [PATCH] Return the received object if scopes configuration is nil
---
lib/has_scope.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/has_scope.rb b/lib/has_scope.rb
index 5f2de75..b8b1eab 100644
--- a/lib/has_scope.rb
+++ b/lib/has_scope.rb
@@ -89,7 +89,7 @@ module HasScope
# end
#
def apply_scopes(target)
- return unless scopes_configuration
+ return target unless scopes_configuration
self.scopes_configuration.each do |scope, options|
next unless apply_scope_to_action?(options)
--
1.6.3.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment