d'oh
- just check for existance before accessing in services initializer - before_validation has no option :post - dry up routes.rb
This commit is contained in:
parent
9f7a066a44
commit
668c4ddfc5
3 changed files with 18 additions and 10 deletions
|
|
@ -16,7 +16,7 @@ class User < ActiveRecord::Base
|
||||||
:timeoutable, :token_authenticatable
|
:timeoutable, :token_authenticatable
|
||||||
|
|
||||||
before_validation :strip_and_downcase_username
|
before_validation :strip_and_downcase_username
|
||||||
before_validation :set_current_language, :post => :create
|
before_validation :set_current_language, :on => :create
|
||||||
|
|
||||||
validates_presence_of :username
|
validates_presence_of :username
|
||||||
validates_uniqueness_of :username
|
validates_uniqueness_of :username
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,15 @@
|
||||||
# Copyright (c) 2010, Diaspora Inc. This file is
|
# Copyright (c) 2011, Diaspora Inc. This file is
|
||||||
# licensed under the Affero General Public License version 3 or later. See
|
# licensed under the Affero General Public License version 3 or later. See
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
Rails.application.config.middleware.use OmniAuth::Builder do
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
||||||
provider :twitter, SERVICES['twitter']['consumer_key'], SERVICES['twitter']['consumer_secret']
|
if SERVICES['twitter'] && SERVICES['twitter']['consumer_key'] && SERVICES['twitter']['consumer_secret']
|
||||||
provider :tumblr, SERVICES['tumblr']['consumer_key'], SERVICES['tumblr']['consumer_secret']
|
provider :twitter, SERVICES['twitter']['consumer_key'], SERVICES['twitter']['consumer_secret']
|
||||||
provider :facebook, SERVICES['facebook']['app_id'], SERVICES['facebook']['app_secret'], :scope => "publish_stream,email,offline_access"
|
end
|
||||||
|
if SERVICES['tumblr'] && SERVICES['tumblr']['consumer_key'] && SERVICES['tumblr']['consumer_secret']
|
||||||
|
provider :tumblr, SERVICES['tumblr']['consumer_key'], SERVICES['tumblr']['consumer_secret']
|
||||||
|
end
|
||||||
|
if SERVICES['facebook'] && SERVICES['facebook']['app_id'] && SERVICES['facebook']['app_secret']
|
||||||
|
provider :facebook, SERVICES['facebook']['app_id'], SERVICES['facebook']['app_secret'], :scope => "publish_stream,email,offline_access"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2010, Diaspora Inc. This file is
|
# Copyright (c) 2011, Diaspora Inc. This file is
|
||||||
# licensed under the Affero General Public License version 3 or later. See
|
# licensed under the Affero General Public License version 3 or later. See
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
|
|
@ -87,12 +87,15 @@ Diaspora::Application.routes.draw do
|
||||||
resources :aspect_memberships, :only => [:destroy, :create, :update]
|
resources :aspect_memberships, :only => [:destroy, :create, :update]
|
||||||
resources :post_visibilities, :only => [:update]
|
resources :post_visibilities, :only => [:update]
|
||||||
|
|
||||||
get 'people/tag_index' => 'people#tag_index'
|
|
||||||
resources :people, :except => [:edit, :update] do
|
resources :people, :except => [:edit, :update] do
|
||||||
resources :status_messages
|
resources :status_messages
|
||||||
resources :photos
|
resources :photos
|
||||||
get :contacts
|
get :contacts
|
||||||
post 'by_handle' => :retrieve_remote, :on => :collection, :as => 'person_by_handle'
|
collection do
|
||||||
|
post 'by_handle' => :retrieve_remote, :as => 'person_by_handle'
|
||||||
|
get :tag_index
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue