Created
May 2, 2011 17:38
-
-
Save notnoop/951983 to your computer and use it in GitHub Desktop.
Sample case to show an infinite recursion in ProtoUser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package code | |
import org.specs._ | |
import net.liftweb.common._ | |
import net.liftweb.record._ | |
// Please note that program compiles without me providing a save method! | |
class User extends MegaProtoUser[User] with Record[User] { | |
def meta = User | |
def valUnique(errorMsg: => String)(email: String) = Nil | |
} | |
object User extends User with MetaMegaProtoUser[User] with MetaRecord[User] { | |
lazy val user = User.createRecord | |
def userFromStringId(id: String) : Box[User] = Full(user) | |
def findUserByUniqueId(id: String) : Box[User] = Full(user) | |
def findUserByUserName(email: String) : Box[User] = Full(user) | |
} | |
object ProtoUserSpec extends Specification { | |
"ProtoUser save shouldn't cause exception" in { | |
User.validateUser("1") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment