Commit 9ee879c
Changed files (3)
lib
humble
lib/humble/column.rb
@@ -32,5 +32,9 @@ module Humble
def apply(id, entity)
entity.instance_variable_set("@#{column_name}", id ) if primary_key?
end
+
+ def destroy(connection, entity)
+ connection.where(column_name.to_sym => entity.id).delete if primary_key?
+ end
end
end
lib/humble/database_table.rb
@@ -27,7 +27,7 @@ module Humble
end
def destroy(connection, entity)
- connection[@name].where(:id => entity.id).delete
+ primary_key_column.destroy(connection[@name], entity)
end
private
Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- humble (0.0.1374367070)
+ humble (0.0.1374367205)
sequel
GEM