提交 b708a605 编写于 作者: D David Heinemeier Hansson

Use consistent references

上级 748b21db
......@@ -19,7 +19,7 @@
private
def set_current
Current.account = Account.find(params[:account_id])
Current.person = Current.account.people.find(params[:person_id])
Current.user = Current.account.users.find(params[:user_id])
end
end
......@@ -40,8 +40,8 @@
end
class Event < ApplicationRecord
belongs_to :creator, class_name: 'Person'
before_validation { self.creator ||= Current.person }
belongs_to :creator, class_name: 'User'
before_validation { self.creator ||= Current.user }
end
*DHH*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册