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

Use consistent references

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