diff --git a/app/models/user.rb b/app/models/user.rb index f3367db59..4a30fcaf0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -179,6 +179,7 @@ class User < Principal ##### has_many :shares ,:dependent => :destroy + has_one :user_wechat # add by zjc has_one :level, :class_name => 'UserLevels', :dependent => :destroy diff --git a/app/models/user_wechat.rb b/app/models/user_wechat.rb index f77e3273d..446655afd 100644 --- a/app/models/user_wechat.rb +++ b/app/models/user_wechat.rb @@ -1,3 +1,6 @@ class UserWechat < ActiveRecord::Base - # attr_accessible :title, :body + attr_accessible :subscribe, :openid, :nickname, :sex, :language, :city, :province, :country, + :headimgurl, :subscribe_time, :unionid, :remark, :groupid, :user + + belongs_to :user end