.where returns an Arel relation, which is an object referencing one or more
model instances. In this case it always returns a single user relation
since a proof can belong to a single user. In order to access the
referenced model you need to call .first.
 Le 20 mars 2014 04:12, "Akshat Pradhan" <notifications@github.com> a écrit
:

> In app/models/requirement.rb:
>
> > @@ -4,7 +4,7 @@ class Requirement
> >    field :description, type: String
> >    has_many :proofs
> >
> > -  def user_proof(user)
> > +  def proof_for(user)
> >      proofs.where(user: user).first
>
> I'm still not entirely sure I understand why first needs to be there.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/akshatpradhan/compliance_chimp/pull/31/files#r10781531>
> .
>