Permalink
Browse files

Do not send nil to build (Datamapper compability)

  • Loading branch information...
1 parent 529cd8b commit d5049240e2a808acb509e9d639995e7f36e21776 @josevalim josevalim committed Nov 21, 2009
Showing with 4 additions and 1 deletion.
  1. +3 −0 CHANGELOG.rdoc
  2. +1 −1 lib/devise/controllers/helpers.rb
View
3 CHANGELOG.rdoc
@@ -1,3 +1,6 @@
+* enhancements
+ * [#42] Do not send nil to build (DataMapper compatibility)
+
== 0.5.5
* enhancements
View
2 lib/devise/controllers/helpers.rb
@@ -59,7 +59,7 @@ def resource=(new_resource)
def build_resource
self.resource ||= begin
attributes = params[resource_name].try(:except, :password, :password_confirmation)
- resource_class.new(attributes)
+ resource_class.new(attributes || {})
end
end

0 comments on commit d504924

Please sign in to comment.