on(users)(s => declare(
s.email.is(unique, indexed)
))
too many arguments for method apply: (index: Int)Char in class StringOps
[error] s.email is(unique, indexed)
Hi,
I want to add column attributes (like "indexed" and "unique") to e-mail field of User (using squeryl-record protouser).
When I do it like described here http://squeryl.org/schema-definition.html
on(users)(s => declare( s.email.is(unique, indexed) ))
Andrzej,
Check out the Lift Wiki entry on Squeryl. In particular, you’ll find this in the section on defining a schema:
The “is” function is ambiguous for records, so from version 2.3-SNAPSHOT on, you can use “defineAs” instead. Until then, you can also use “.~.is” if there is a compiler error.
I think that switching to defineAs will resolve your problem.
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
val liftVersion = "2.6.2"
Seq(
"net.liftweb" %% "lift-webkit" % liftVersion % "compile",
"net.liftweb" %% "lift-mapper" % liftVersion % "compile",
//"net.liftmodules" %% "lift-jquery-module_2.6" % "2.8",
"net.liftweb" %% "lift-record" % liftVersion,
"net.liftweb" %% "lift-squeryl-record" % liftVersion,...
on(users)(s => declare(
s.email.~is(unique, indexed)
))
value ~ is not a member of net.liftweb.record.field.EmailField[code.model.User]
[error] s.email.~is(unique, indexed)
Andrzej,
That’s because it would be .~.is
, the initial .~
forces an implicit conversion to the type on which the .is
method exists. Or, you could just do what I suggested in the first place and use defineAs
:)
on(users)(s => declare(
s.email.~.is(unique, indexed)
))
value ~ is not a member of net.liftweb.record.field.EmailField[code.model.User]
[error] s.email.~.is(unique, indexed)
on(users)(s => declare(
s.email defineAs(unique, indexed)
))
value defineAs is not a member of net.liftweb.record.field.EmailField[code.model.User]
[error] s.email defineAs(unique, indexed)