进出口设立是通过电子邮件发送的交易相对于一个人的利益,并提醒服务城市..基本上,用户输入重要的日期(朋友BDAY,周年ECT)和特殊的人的利益。正确Rails的关联安装
我想送他们的交易基于1)用户城市和2)相关人员
的利益应该如何设置我协会的交易模式?
我有什么至今..
class User < ActiveRecord::Base
belongs_to :city
has_many :person_interests, :as => :person
has_many :interests, :through => :person_interests
end
class City < ActiveRecord::Base
attr_accessible :name
belongs_to :province
has_many :users
end
class PersonInterest < ActiveRecord::Base
belongs_to :interest
belongs_to :person, :polymorphic => true
end
class Interest < ActiveRecord::Base
has_many :person_interests
end
谢谢!
到目前为止你有什么?什么不起作用或对你来说不理想? – rfunduk
@rfunduk添加了什么我已经有..一切都很好,并收集我需要精细的信息..只是不知道如何与利益,城市的新的交易模式相关联。 – js111
交易会成为既兴趣又适合城市的belongs_to? – js111