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
|
autotest
|
||||||
bson (= 1.0.7)
|
bson (= 1.0.7)
|
||||||
bson_ext (= 1.0.7)
|
bson_ext (= 1.0.7)
|
||||||
bundler (= 1.0.0)
|
bundler (>= 1.0.0)
|
||||||
capybara (~> 0.3.9)
|
capybara (~> 0.3.9)
|
||||||
carrierwave!
|
carrierwave!
|
||||||
cucumber-rails (= 0.3.2)
|
cucumber-rails (= 0.3.2)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@ class PhotosController < ApplicationController
|
||||||
respond_to :json, :only => :show
|
respond_to :json, :only => :show
|
||||||
|
|
||||||
def create
|
def create
|
||||||
album = Album.find_by_id params[:album_id]
|
album = current_user.find_visible_post_by_id( params[:album_id] )
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
######################## dealing with local files #############
|
######################## dealing with local files #############
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ class UsersController < ApplicationController
|
||||||
@user = current_user
|
@user = current_user
|
||||||
@person = @user.person
|
@person = @user.person
|
||||||
@profile = @user.person.profile
|
@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",
|
@fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create",
|
||||||
:scope=>MiniFB.scopes.join(","))
|
:scope=>MiniFB.scopes.join(","))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue