I want a method within
class User < ActiveRecord::Base
def global_user_id
User.find_by_username("Global_User").id
end
end
which returns the current global user ID. I want it to be run using User.global_user_id
rather than something like User.new.global_user_id
How would I do this?
I'm needing the user ID in other models and right now its stuck in class resources which I dont think is the best spot.