如何从Rails中的关联模型中检索数据?

时间:2015-08-27 08:45:32

标签: ruby-on-rails ruby activerecord associations model-associations

我有3个型号:

Sub Test()
Application.ScreenUpdating = False
Dim i As Integer
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To Lastrow
'To hide sheets
Sheets(Cells(i, 1).Value).Visible = False
'To hide row on sheet
Rows(Cells(i, 2).Value).Hidden = True
'To hide row on specific sheet
Sheets(Cells(i, 1).Value).Rows(Cells(i, 2).Value).Hidden = True

Next
Application.ScreenUpdating = True
End Sub

对于每个订单,我想根据销售人员的佣金率计算佣金。如何通过订单的客户从Salesperson.rb模型中检索销售人员的佣金率?

0 个答案:

没有答案