[Rails] Re: is equal operator to check current user is owner

2011-02-13 Thread msaspence
On Feb 13, 7:47 am, Frederick Cheung frederick.che...@gmail.com wrote: On Feb 12, 10:01 am, msaspence msaspe...@gmail.com wrote: I'm using the Authlogic so have followed the instructions herehttp://rdoc.info/github/binarylogic/authlogic/master/Authlogic/TestCase Have you tried

[Rails] Re: is equal operator to check current user is owner

2011-02-13 Thread msaspence
I'm the biggest noob in the world the comparison was comparing them correctly I had a typo in my test assertion that was causing it to fail when it should have passed apologies for the trouble i will get on and look at ruby-debug though -- You received this message because you are subscribed

[Rails] Login user UserSession.create for rspec not working

2011-02-13 Thread msaspence
I've got a show action for a map object which should return 200 if the current_user is the maps owner I have defined a method on my user object current? which returns true or false if that user is the same as the current user I have model spec set up for that which mocks UserSession.find.user

[Rails] Re: is equal operator to check current user is owner

2011-02-12 Thread msaspence
On Feb 12, 9:53 am, Colin Law clan...@googlemail.com wrote: On 11 February 2011 22:40, msaspence msaspe...@gmail.com wrote: I'm want to restrict access to an object show action to the owner in my action I have this def show    @thing = Thing.find(params[:id])    if current_user

[Rails] Re: is equal operator to check current user is owner

2011-02-12 Thread msaspence
On Feb 12, 9:21 am, Frederick Cheung frederick.che...@gmail.com wrote: On Feb 11, 10:40 pm, msaspence msaspe...@gmail.com wrote: I'm want to restrict access to an object show action to the owner in my action I have this def show     @thing = Thing.find(params[:id

[Rails] Re: is equal operator to check current user is owner

2011-02-12 Thread msaspence
On Feb 12, 10:11 am, Colin Law clan...@googlemail.com wrote: On 12 February 2011 10:00, msaspence msaspe...@gmail.com wrote: On Feb 12, 9:53 am, Colin Law clan...@googlemail.com wrote: On 11 February 2011 22:40, msaspence msaspe...@gmail.com wrote: I'm want to restrict access

[Rails] Re: is equal operator to check current user is owner

2011-02-12 Thread msaspence
On Feb 12, 10:11 am, Colin Law clan...@googlemail.com wrote: On 12 February 2011 10:00, msaspence msaspe...@gmail.com wrote: On Feb 12, 9:53 am, Colin Law clan...@googlemail.com wrote: On 11 February 2011 22:40, msaspence msaspe...@gmail.com wrote: I'm want to restrict access

[Rails] is equal operator to check current user is owner

2011-02-11 Thread msaspence
I'm want to restrict access to an object show action to the owner in my action I have this def show @thing = Thing.find(params[:id]) if current_user @thing.owner == current_user respond_to do |format| format.json { render :json = @thing } end else render