Skip to content

Commit

Permalink
more querying through the current_user in controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgrippi committed Oct 5, 2010
1 parent 85f71aa commit aed9125
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Expand Up @@ -258,7 +258,7 @@ DEPENDENCIES
autotest
bson (= 1.0.7)
bson_ext (= 1.0.7)
bundler (= 1.0.0)
bundler (>= 1.0.0)
capybara (~> 0.3.9)
carrierwave!
cucumber-rails (= 0.3.2)
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/photos_controller.rb
Expand Up @@ -9,7 +9,8 @@ class PhotosController < ApplicationController
respond_to :json, :only => :show

def create
album = Album.find_by_id params[:album_id]
album = current_user.find_visible_post_by_id( params[:album_id] )

begin

######################## dealing with local files #############
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Expand Up @@ -13,7 +13,7 @@ def edit
@user = current_user
@person = @user.person
@profile = @user.person.profile
@photos = Photo.find_all_by_person_id(@person.id).paginate :page => params[:page], :order => 'created_at DESC'
@photos = current_user.visible_posts(:person_id => current_user.person.id, :_type => 'Photo').paginate :page => params[:page], :order => 'created_at DESC'

@fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create",
:scope=>MiniFB.scopes.join(","))
Expand Down

0 comments on commit aed9125

Please sign in to comment.