Permalink
Browse files

Use insert instead of << to retrieve id of inserted record in newer v…

…ersions of Sequel.
  • Loading branch information...
1 parent bbd0f96 commit 6323be42e74937903637ecee9ccdded80ed491f6 @nathansobo committed Mar 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/prequel/record.rb
View
2 lib/prequel/record.rb
@@ -213,7 +213,7 @@ def save
before_save
self.created_at = Time.now if fields_by_name.has_key?(:created_at)
self.updated_at = Time.now if fields_by_name.has_key?(:updated_at)
- self.id = (DB[table.name] << field_values_without_id)
+ self.id = (DB[table.name].insert field_values_without_id)
Prequel.session[table.name][id] = self
mark_clean
after_create

0 comments on commit 6323be4

Please sign in to comment.