lawrencepit-machinery 0.4 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/machinery/active_record.rb +7 -1
- metadata +1 -1
@@ -11,7 +11,13 @@ module Machinery
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.clear
|
14
|
-
@@toys.each
|
14
|
+
@@toys.each do |toy|
|
15
|
+
toy.connection.delete(
|
16
|
+
"DELETE FROM #{toy.class.quoted_table_name} " +
|
17
|
+
"WHERE #{toy.connection.quote_column_name(toy.class.primary_key)} = #{toy.quoted_id}",
|
18
|
+
"#{toy.class.name} Destroy"
|
19
|
+
)
|
20
|
+
end
|
15
21
|
@@toys = []
|
16
22
|
end
|
17
23
|
|