config/routes.rb in social_stream-base-0.19.1 vs config/routes.rb in social_stream-base-0.19.2

- old
+ new

@@ -1,24 +1,13 @@ Rails.application.routes.draw do - #Background tasks - resque_constraint = lambda do |request| - #request.env['warden'].authenticate? and request.env['warden'].user.admin? - true - end - - constraints resque_constraint do - mount Resque::Server, :at => "/resque" - end - root :to => "frontpage#index" match 'home' => 'home#index', :as => :home match 'home' => 'home#index', :as => :user_root # devise after_sign_in_path_for - - # Webfinger - match '.well-known/host-meta',:to => 'frontpage#host_meta' - + + match 'search' => 'search#index', :as => :search + # Social Stream subjects configured in config/initializers/social_stream.rb SocialStream.subjects.each do |actor| resources actor.to_s.pluralize do resource :like resource :profile @@ -38,39 +27,40 @@ # /posts (SocialStream.objects - [ :actor ]).each do |object| resources object.to_s.pluralize end - case SocialStream.relation_model - when :follow - resources :followers + resources :comments + + constraints SocialStream::Routing::Constraints::Custom.new do resources :contacts do collection do get 'pending' end end - when :custom - resources :contacts do - collection do - get 'pending' - end - end namespace "relation" do resources :customs end resources :permissions end + constraints SocialStream::Routing::Constraints::Follow.new do + match 'followings' => 'followers#index', :as => :followings, :defaults => { :direction => 'sent' } + match 'followers' => 'followers#index', :as => :followers, :defaults => { :direction => 'received' } + resources :followers + + resources :contacts do + collection do + get 'pending' + end + end + end + resources :activity_actions - match 'tags' => 'tags#index', :as => 'tags' - - # Find subjects by slug - match 'subjects/lrdd/:id' => 'subjects#lrdd', :as => 'subject_lrdd' - resource :representation resources :settings do collection do put 'update_all' @@ -87,23 +77,20 @@ collection do put 'update_all' end end - resources :comments - resources :activities do resource :like end - match 'search' => 'search#index', :as => :search - match 'cheesecake' => 'cheesecake#index', :as => :cheesecake match 'update_cheesecake' => 'cheesecake#update', :as => :update_cheesecake match 'ties' => 'ties#index', :as => :ties + match 'tags' => 'tags#index', :as => 'tags' ##API### match 'api/keygen' => 'api#create_key', :as => :api_keygen match 'api/user/:id' => 'api#users', :as => :api_user match 'api/me' => 'api#users', :as => :api_me @@ -111,6 +98,18 @@ match 'api/user/:id/public' => 'api#activity_atom_feed', :format => 'atom', :as => :api_user_activities match 'api/me/contacts' => 'contacts#index', :format => 'json', :as => :api_contacts match 'api/subjects/:s/contacts' => 'contacts#index', :format => 'json', :as => :api_subject_contacts ##/API## + + + #Background tasks + constraints SocialStream::Routing::Constraints::Resque.new do + mount Resque::Server, :at => "/resque" + end + + # Webfinger + match '.well-known/host-meta',:to => 'frontpage#host_meta' + + # Find subjects by slug + match 'subjects/lrdd/:id' => 'subjects#lrdd', :as => 'subject_lrdd' end