>
> >Member.where(status: "active")
> >will give you the members, then you can use each to get
> member.member_code
>
> Hello Colin thank you very much. I was able to access member and loan
table from recovery model.
In rails guides i'm not able to find how to pass a variable to where
clause.
eg: I have retrieved the member_code of all members whose status is
1(active) and extracted member_code like this
@member = Member.where(record_status: "1")
@member.each do |member|
tmember_code = member.member_code
Now I want to pass tmember_code to where clause to perform some operation
on LoanTable. Is this the correct way?
@loan = LoanTable.where(:memberCode => tmember_code, :loanType => "1")
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/460db5c7-6d46-4ba4-b713-a0a3a572d5bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.