trait Customerize[A <: MetaMapper[A] with CustomerFields[A]] {
self: A with KeyedMetaMapper[Long, A] with CustomerFields[A] =>
def findForCustomer(params: QueryParam[A]*): Box[A] = {
var seq = Seq()
if (!User.isAdmin_?) seq += By(self.customer, User
I've got this so far. The CustomerFields trait just appends the
customer's object to the class.
The Customerize trait is for extending the singleton.
Firs thing, Jeppe wrote to use the find method, which doesn't seem to
be available there. At least it doesn't find it.
So i switched to findAll (whi
I will implement it into my own MetaMapper-sub-trait so all of my
models can share the code.
Thank you all for your input!
On Jan 21, 9:44 am, Jeppe Nejsum Madsen wrote:
> Naftoli Gugenheim writes:
> > Why not define a new method?
> > def findByCurUser(params: QueryParam*) = User.currentUser.fl