0
我正在使用ActiveAdmin。我需要存儲創建或更新每條記錄的用戶。在Rails3中獲取模型中的當前用戶
因此,我將user_created_id和user_updated_id添加到每個模型。 在before_save上,我想存儲有關current_admin_user的信息。問題是我無法訪問模型中的current_admin_user。
有沒有辦法做到這一點,而不打破MVC?
我發現這個:http://rails-bestpractices.com/posts/47-fetch-current-user-in-models 但我不確定它是否安全。
任何幫助?
我正在使用ActiveAdmin,這意味着我正在使用ActiveAdmin控制器。 – Tony