removed unused repost method, going through the warden object
This commit is contained in:
parent
c2b84fd9c6
commit
6e407572c4
4 changed files with 4 additions and 19 deletions
|
|
@ -41,7 +41,7 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
def fb_user_info
|
||||
if current_user
|
||||
@access_token = env['warden'].session[:access_token]
|
||||
@access_token = warden.session[:access_token]
|
||||
@logged_in = @access_token.present?
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -17,15 +17,15 @@ class ServicesController < ApplicationController
|
|||
|
||||
# TODO: This is where you'd want to store the token in your database
|
||||
# but for now, we'll just keep it in the session so we don't need a database
|
||||
env['warden'].session[:access_token] = @access_token
|
||||
warden.session[:access_token] = @access_token
|
||||
flash[:success] = "Authentication successful."
|
||||
end
|
||||
redirect_to edit_user_url current_user
|
||||
end
|
||||
|
||||
def destroy
|
||||
env['warden'].session[:access_token] = nil
|
||||
env['warden'].session[:user_id] = nil
|
||||
warden.session[:access_token] = nil
|
||||
warden.session[:user_id] = nil
|
||||
redirect_to edit_user_url current_user
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -114,12 +114,6 @@ class User
|
|||
post
|
||||
end
|
||||
|
||||
def repost( post, options = {} )
|
||||
aspect_ids = validate_aspect_permissions(options[:to])
|
||||
push_to_aspects(post, aspect_ids)
|
||||
post
|
||||
end
|
||||
|
||||
def update_post( post, post_hash = {} )
|
||||
if self.owns? post
|
||||
post.update_attributes(post_hash)
|
||||
|
|
|
|||
|
|
@ -46,15 +46,6 @@ describe User do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#repost' do
|
||||
it 'should make the post visible in another aspect' do
|
||||
status_message = user.post(:status_message, :message => "hello", :to => aspect.id)
|
||||
user.repost(status_message, :to => aspect1.id)
|
||||
aspect1.reload
|
||||
aspect1.posts.count.should be 1
|
||||
end
|
||||
end
|
||||
|
||||
describe '#update_post' do
|
||||
it 'should update fields' do
|
||||
album = user.post(:album, :name => "Profile Photos", :to => aspect.id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue