MagmaCollection problem
Hilaire Fernandes
hilaire at ofset.org
Sun Feb 17 19:08:23 UTC 2008
Oleg Korsak a écrit :
> Hello!
>
> I have an empty magma database (I'm using Keithy's ToDo tutorial
> application with Magma seasideHelper). This one:
> http://wiki.squeak.org/squeak/6021
> So please get the latest version (7) so you can answer on my question :)
>
> In the StMagmaDatabase->#createDefaultUser (which is temporary called
> from #findUserByEmail) I'm initializing a database and adding one user
> with 'todo at todo.tut <mailto:todo at todo.tut>' email:
>
> | user |
>
> self initialize.
>
> user := StUser new.
> user id: 1.
> user email: 'todo at todo.tut <mailto:todo at todo.tut>'.
> user userName: 'todo'.
> user password: 'todo'.
> self addUser: user.
>
> then I'm trying to find user by email ('todo at todo.tz
> <mailto:todo at todo.tz>'). BUT... I'm getting a wrong result
>
> user := self users where: [:each |
> each read: #email at: 'todo.tz <http://todo.tz>'.
> ].
I am wondering, does your where query should look like:
user := self users where: [:each | each email includesAllOf: 'todo.tz'].
Of course, you should have an index on the email attribute, and the
addUser: method should do a commit behind the scene. But I guess this is
what is doing seaside helper.
Hilaire
More information about the Magma
mailing list