case _ if f eq ... ?

-------------------------------------
Jeppe Nejsum Madsen<je...@ingolfs.dk> wrote:

Hi,

I would expect the following code to print at most a single line:

 Vehicle.mappedFields.filter(_.dbIncludeInForm_?) foreach {f =>
         f match {
           case Vehicle.customCategory => Log.info("Matched on field: "+f.name)
           case _ =>
         }
       }

But what happens is that the following:

15:57:27.917 [tp-1441471922-0] INFO  lift
   - Matched on field: organizationalUnit
15:57:27.918 [tp-1441471922-0] INFO  lift
   - Matched on field: price
15:57:27.918 [tp-1441471922-0] INFO  lift
   - Matched on field: tax
15:57:27.918 [tp-1441471922-0] INFO  lift
   - Matched on field: customCategory
15:57:27.918 [tp-1441471922-0] INFO  lift
   - Matched on field: vehicleType

I think what happens is that the equals method of MappedField compares
the value of the fields, which is 0 in the above cases. But this
doesn't make much sense when it is really the meta fields that are
being compared.

Is it possible somehow to match on the fields, not the field values?

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to