Rails 4.1 & Ruby 2.0
Here's what I have in lib/global_methods.rb:
def admin_status? (id = nil)
role_value = I18n.t 'admin_role'
unless id
current_user.role == role_value
else
determine_user_role (id, role_value)
end
end
def determine_user_role (id, role_value)
user = User.find_by id: id
user.role == role_value
end
Here's what I have in application_controller.rb
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
require ('json')
require ('csv')
require ('global_methods')
end
I am getting the following error:
syntax error, unexpected ',', expecting ')'
and it points to line 7 in application_controller.rb as the culprit. If delete the functions from global_method.rb, I no longer get the error. I can't see the syntax problem. Any ideas?