Skip to content

Commit

Permalink
fixed bug with sharing new todos.
Browse files Browse the repository at this point in the history
  • Loading branch information
noctivityinc committed May 24, 2010
1 parent c5bda2b commit 185f752
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.textile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/models/invite_todo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion app/models/share.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion app/models/todo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion public/javascripts/controllers/public/todos.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
});
Expand Down

0 comments on commit 185f752

Please sign in to comment.