status_for 0.0.5 → 0.0.6
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.
@@ -95,7 +95,7 @@ module StatusFor
|
|
95
95
|
|
96
96
|
module StatusInstanceMethods
|
97
97
|
|
98
|
-
def method_missing(method_id, subject_ids, &block)
|
98
|
+
def method_missing(method_id, *subject_ids, &block)
|
99
99
|
# This creates a method for instanced object called 'mark_as_status_for(subject)' that
|
100
100
|
# adds the subject id into relevant database column.
|
101
101
|
# Example: @message.mark_as_deleted_for(user)
|
@@ -164,10 +164,10 @@ module StatusFor
|
|
164
164
|
if !self.class.column_names.include?(method_id + '_for')
|
165
165
|
raise "need to include the #{method_id}_for column in #{self.class.table_name} table"
|
166
166
|
end
|
167
|
-
unless subject_id.is_a? Integer
|
167
|
+
unless subject_id.first.is_a? Integer
|
168
168
|
raise "subject_id must be an Integer!"
|
169
169
|
end
|
170
|
-
return status_for_psql_array_to_array(self.send ((method_id +'_for').to_sym)).include?(subject_id)
|
170
|
+
return status_for_psql_array_to_array(self.send ((method_id +'_for').to_sym)).include?(subject_id.first)
|
171
171
|
end
|
172
172
|
end
|
173
173
|
|
data/lib/status_for/version.rb
CHANGED