mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-01-28 03:07:55 -05:00
PT: https://www.pivotaltracker.com/story/show/51457917 Maco found this. The problem was that if you had a blank planting date, and then re-edited the planting, it would say "not yet set" in the form field, then die when it later tried to convert that to a date. I replaced Miles's planted_at_string stuff in the model with a simpler parse_date method in the application helper.
19 lines
522 B
Ruby
19 lines
522 B
Ruby
class ApplicationController < ActionController::Base
|
|
protect_from_forgery
|
|
|
|
include ApplicationHelper
|
|
|
|
# tweak CanCan defaults because we don't have a "current_user" method
|
|
# this means that we use current_user in specs but current_member everywhere
|
|
# else in the code.
|
|
def current_ability
|
|
@current_ability ||= Ability.new(current_member)
|
|
end
|
|
|
|
# CanCan error handling
|
|
rescue_from CanCan::AccessDenied do |exception|
|
|
redirect_to request.referer || root_url, :alert => exception.message
|
|
end
|
|
|
|
end
|