diff --git a/lib/usesguid/active_record_extensions.rb b/lib/usesguid/active_record_extensions.rb index 246be3a..9192fc8 100644 --- a/lib/usesguid/active_record_extensions.rb +++ b/lib/usesguid/active_record_extensions.rb @@ -31,7 +31,7 @@ def usesguid(options = {}) class_eval do set_primary_key options[:column] if options[:column] - before_create :assign_guid + before_validation :assign_guid # Give this record a guid id. Public method so people can call it before save if necessary. def assign_guid @@ -49,4 +49,4 @@ def assign_guid end end -end \ No newline at end of file +end