From 8bc857cf4d2953dfc30097baaa0af6b375e26968 Mon Sep 17 00:00:00 2001
From: zhitomirskiyi <ilya@joindiaspora.com>
Date: Wed, 26 Jan 2011 13:41:13 -0800
Subject: [PATCH] updated devise added a devise_invitable fork and performed
 migration

---
 Gemfile                  |  4 ++--
 Gemfile.lock             | 22 +++++++++++++++-------
 app/models/invitation.rb |  2 +-
 db/schema.rb             | 10 +++++-----
 4 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/Gemfile b/Gemfile
index 24ec75a725..452bda8c37 100644
--- a/Gemfile
+++ b/Gemfile
@@ -11,8 +11,8 @@ gem 'nokogiri', '1.4.3.1'
 gem "fog"
 
 #Security
-gem 'devise', '1.1.3'
-gem 'devise_invitable','0.3.5'
+gem 'devise', '1.2.rc'
+gem 'devise_invitable', :git => 'git://github.com/zhitomirskiyi/devise_invitable.git'
 
 #Authentication
 gem 'omniauth', '0.1.6'
diff --git a/Gemfile.lock b/Gemfile.lock
index 60837bd83d..b6c870f46e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -44,6 +44,14 @@ GIT
     carrierwave (0.5.0)
       activesupport (~> 3.0)
 
+GIT
+  remote: git://github.com/zhitomirskiyi/devise_invitable.git
+  revision: a52f9638f900c1af77855ec357a0c861fbb12e83
+  specs:
+    devise_invitable (0.4.rc)
+      devise (~> 1.2.rc)
+      rails (~> 3.0.0)
+
 PATH
   remote: vendor/gems/jasmine
   specs:
@@ -137,11 +145,10 @@ GEM
     culerity (0.2.14)
     daemons (1.1.0)
     database_cleaner (0.6.0)
-    devise (1.1.3)
+    devise (1.2.rc)
       bcrypt-ruby (~> 2.1.2)
-      warden (~> 0.10.7)
-    devise_invitable (0.3.5)
-      devise (~> 1.1.0)
+      orm_adapter (~> 0.0.2)
+      warden (~> 1.0.2)
     diff-lcs (1.1.2)
     erubis (2.6.6)
       abstract (>= 1.0.0)
@@ -257,6 +264,7 @@ GEM
       oa-enterprise (= 0.1.6)
       oa-oauth (= 0.1.6)
       oa-openid (= 0.1.6)
+    orm_adapter (0.0.4)
     polyglot (0.3.1)
     pyu-ruby-sasl (0.0.3.2)
     rack (1.2.1)
@@ -343,7 +351,7 @@ GEM
     uuidtools (2.1.1)
     vegas (0.1.8)
       rack (>= 1.0.0)
-    warden (0.10.7)
+    warden (1.0.3)
       rack (>= 1.0.0)
     webmock (1.6.2)
       addressable (>= 2.2.2)
@@ -366,8 +374,8 @@ DEPENDENCIES
   cloudfiles (= 1.4.10)
   cucumber-rails (= 0.3.2)
   database_cleaner (= 0.6.0)
-  devise (= 1.1.3)
-  devise_invitable (= 0.3.5)
+  devise (= 1.2.rc)
+  devise_invitable!
   em-websocket!
   factory_girl_rails
   fastercsv (= 1.5.4)
diff --git a/app/models/invitation.rb b/app/models/invitation.rb
index 4cbe2e7749..134cb28cf8 100644
--- a/app/models/invitation.rb
+++ b/app/models/invitation.rb
@@ -71,7 +71,7 @@ class Invitation < ActiveRecord::Base
       opts[:from].save!
       invitee.reload
     end
-    invitee.invite!
+    invitee.invite!(:email => (opts[:service] == 'email'))
     Rails.logger.info("event=invitation_sent to=#{opts[:identifier]} #{"inviter=#{opts[:from].diaspora_handle}" if opts[:from]}")
     invitee
   end
diff --git a/db/schema.rb b/db/schema.rb
index 1db5153d10..6695d5187e 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version => 20110125190034) do
+ActiveRecord::Schema.define(:version => 20110126015407) do
 
   create_table "aspect_memberships", :force => true do |t|
     t.integer  "aspect_id"
@@ -273,8 +273,7 @@ ActiveRecord::Schema.define(:version => 20110125190034) do
     t.string   "language"
     t.string   "email",                                 :default => "", :null => false
     t.string   "encrypted_password",     :limit => 128, :default => "", :null => false
-    t.string   "password_salt",                         :default => "", :null => false
-    t.string   "invitation_token",       :limit => 20
+    t.string   "invitation_token",       :limit => 60
     t.datetime "invitation_sent_at"
     t.string   "reset_password_token"
     t.string   "remember_token"
@@ -434,8 +433,7 @@ ActiveRecord::Schema.define(:version => 20110125190034) do
     t.string   "language"
     t.string   "email",                                 :default => "",    :null => false
     t.string   "encrypted_password",     :limit => 128, :default => "",    :null => false
-    t.string   "password_salt",                         :default => "",    :null => false
-    t.string   "invitation_token",       :limit => 20
+    t.string   "invitation_token",       :limit => 60
     t.datetime "invitation_sent_at"
     t.string   "reset_password_token"
     t.string   "remember_token"
@@ -448,6 +446,8 @@ ActiveRecord::Schema.define(:version => 20110125190034) do
     t.datetime "created_at"
     t.datetime "updated_at"
     t.string   "mongo_id"
+    t.string   "invitation_service"
+    t.string   "invitation_identifier"
   end
 
   add_index "users", ["email"], :name => "index_users_on_email", :unique => true
-- 
GitLab