status_for 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,20 +27,20 @@ module StatusFor
|
|
27
27
|
end
|
28
28
|
|
29
29
|
|
30
|
-
def method_missing(method_id, subject)
|
30
|
+
def method_missing(method_id, *subject, &block)
|
31
31
|
# This creates a method for self called 'status_for(subject)' that finds all the
|
32
32
|
# self items with the 'status_for' with the subject id.
|
33
33
|
# Example: Message.deleted_for(user)
|
34
34
|
# Returns array of messages which contains user.id in the message's 'deleted_for'
|
35
35
|
if method_id.to_s =~ /^([a-z]+)_for$/
|
36
|
-
run_find_status_for($1, subject)
|
36
|
+
run_find_status_for($1, subject.first)
|
37
37
|
|
38
38
|
# This creates a method for self called 'not_status_for(subject)' that finds all the
|
39
39
|
# self items with the 'status_for' THAT DOES NOT HAVE the subject id.
|
40
40
|
# Example: Message.deleted_for(user)
|
41
41
|
# Returns array of messages which DOES NOT contain user.id in the message's 'deleted_for'
|
42
42
|
elsif method_id.to_s =~ /^not_([a-z]+)_for$/
|
43
|
-
run_find_not_status_for($1, subject)
|
43
|
+
run_find_not_status_for($1, subject.first)
|
44
44
|
else
|
45
45
|
super
|
46
46
|
end
|
data/lib/status_for/version.rb
CHANGED