使用C#4.0
接着我的问题,,我感到困惑,这可能是因为我的班级设计是错误的。
市场模拟金融市场。经纪人给能够与许多市场互动的金融经纪人建模。一个市场可以与许多经纪人互动。请参阅下面的Broker和Market类。
public class Market
{
public int Id { get; set; }
public string Symbol { get; set; }
public string Description { get; set; }
}
public class Broker
{
public int Id { get; set;
我在一个多态关系的模型上从一个非常基本的范围得到了一些奇怪的结果。以下是这些关系的简要总结和细节。
模型/金融学
class Financial < ActiveRecord::Base
belongs_to :financiable, :polymorphic => true
#ltm is a boolean field in the model
scope :ltm, -> { where(ltm: true).last }
然后是一个基本的公司模型,它有很多金融机构
型号/Firm.rb
class Firm < ActiveRecord: