ryanb/cancan — Issue #548: unexpected keyword_do_block syntax error in ability.rb (rails 3.2.0rc2)
Author: mixellent
Created: 2012-01-19 16:44:36+00:00
State: open

So I did the mistake of updating my rails version to 3.2.0.rc2. But it seems that of all the plugins that I am using (including devise,omniauth and others) only CanCan is still complaining.

The problem occurs inside the Ability.rb file, where as soon as I use a block statement (see below for example)

can [:update, :destroy], Trip, do |trip|
trip.try(:user) == user
end

I am getting the error "unexpected keyword_do_block" and "unexpected keyword_end, expecting $end". As soon as I remove all my block statements, I am not receiving any errors anymore. Note that my code was working perfectly before upgrading the rails gem.