Browse files

fixed bug with sharing new todos.

  • Loading branch information...
1 parent c5bda2b commit 185f752f721ea56ef7dca8cd723847d087c5ec99 @noctivityinc committed May 24, 2010
View
4 RELEASE_NOTES.textile
@@ -1,5 +1,9 @@
h1. Todopia Release Notes
+h3. 0.3.4 (hotfix)
+* Fixed bug with inviting new users on todo creation
+* upgraded to 2.3.6
+
h3. 0.3.2 (hotfix)
* Added removal of due date option
* Fixed bug with sending daily emails
View
2 app/models/invite_todo.rb
@@ -15,5 +15,5 @@ class InviteTodo < ActiveRecord::Base
belongs_to :todo
validates_presence_of :todo, :invite
- validates_uniqueness_of :todo_id, :scope => :invite_id
+ validates_uniqueness_of :todo_id, :scope => :invite_id, :message => 'has already been used to invite this person'
end
View
2 app/models/share.rb
@@ -15,5 +15,5 @@ class Share < ActiveRecord::Base
belongs_to :todo
validates_presence_of :user, :todo
- validates_uniqueness_of :todo_id, :scope => [:user_id]
+ validates_uniqueness_of :todo_id, :scope => [:user_id], :message => 'has already been shared with this user'
end
View
2 app/models/todo.rb
@@ -192,7 +192,7 @@ def share_by_email(tag)
else
self.notice = "An invitation has been sent to #{email} to share this todo."
invite = self.user.invites.find_or_create_by_email(email)
- invite.invite_todos.create(:todo => self)
+ invite.invite_todos.build(:todo => self)
Postoffice.deliver_invite_and_share(invite, self)
return true
end
View
1 public/javascripts/controllers/public/todos.js
@@ -180,7 +180,6 @@ function setup_add_form() {
error: function(responseText, statusText, xhr, form){
setup_autocomplete();
$('#todo_label').addClass('fieldWithErrors');
- $.flash.show();
},
complete: function(request, status){ ajax_complete(request, status)}
});

0 comments on commit 185f752

Please sign in to comment.