4 5 6 7 8 9 10 11
# File 'lib/tentd/model/user_scoped.rb', line 4 def self.included(base) base.class_eval do belongs_to :user, 'TentD::Model::User' before :valid? do self.user_id ||= User.current.id if User.current end end end