From 7668e8d26211f1edc58d427c0caca28d396708a0 Mon Sep 17 00:00:00 2001
From: danielvincent <danielgrippi@gmail.com>
Date: Thu, 3 Feb 2011 14:10:58 -0800
Subject: [PATCH] fix mobile_fu/ipad issue

---
 db/schema.rb                              | 6 +++---
 vendor/plugins/mobile-fu/lib/mobile_fu.rb | 6 ++++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/db/schema.rb b/db/schema.rb
index a11b1c8e55..c4fbefa114 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -395,7 +395,7 @@ ActiveRecord::Schema.define(:version => 20110202015222) do
   add_index "profiles", ["first_name", "searchable"], :name => "index_profiles_on_first_name_and_searchable"
   add_index "profiles", ["last_name", "searchable"], :name => "index_profiles_on_last_name_and_searchable"
   add_index "profiles", ["mongo_id"], :name => "index_profiles_on_mongo_id"
-  add_index "profiles", ["person_id"], :name => "index_profiles_on_person_id"
+  add_index "profiles", ["person_id"], :name => "index_profiles_on_person_id", :unique => true
 
   create_table "requests", :force => true do |t|
     t.integer  "sender_id",    :null => false
@@ -457,8 +457,8 @@ ActiveRecord::Schema.define(:version => 20110202015222) do
     t.datetime "created_at"
     t.datetime "updated_at"
     t.string   "mongo_id"
-    t.string   "invitation_service",     :limit => 127
-    t.string   "invitation_identifier",  :limit => 127
+    t.string   "invitation_service"
+    t.string   "invitation_identifier"
   end
 
   add_index "users", ["email"], :name => "index_users_on_email"
diff --git a/vendor/plugins/mobile-fu/lib/mobile_fu.rb b/vendor/plugins/mobile-fu/lib/mobile_fu.rb
index 5e85d9d36f..0c69a24a5a 100644
--- a/vendor/plugins/mobile-fu/lib/mobile_fu.rb
+++ b/vendor/plugins/mobile-fu/lib/mobile_fu.rb
@@ -6,7 +6,7 @@ module ActionController
                           'audiovox|motorola|samsung|telit|upg1|windows ce|ucweb|astel|plucker|' +
                           'x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|' +
                           'pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|' +
-                          'webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|' +
+                          'webos|amoi|novarra|cdm|alcatel|pocket|iphone|mobileexplorer|' +
                           'mobile'
 
     def self.included(base)
@@ -84,7 +84,9 @@ module ActionController
       # the device making the request is matched to a device in our regex.
 
       def is_mobile_device?
-        request.user_agent.to_s.downcase =~ Regexp.new(ActionController::MobileFu::MOBILE_USER_AGENTS)
+        # hack for ipad
+        req = request.user_agent.to_s.downcase
+        req =~ Regexp.new(ActionController::MobileFu::MOBILE_USER_AGENTS) && !req.match('ipad')
       end
 
       # Can check for a specific user agent
-- 
GitLab