more querying through the current_user in controllers
This commit is contained in:
parent
85f71aa4aa
commit
aed9125e93
3 changed files with 4 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 #############
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class UsersController < ApplicationController
|
|||
@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(","))
|
||||
|
|
|
|||
Loading…
Reference in a new issue