You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi...this is a pretty noob question....when I use find_by_email I get:
Warning: Defining view User#by_email with keys "email" at call time, please add it to the class body...
I don't know what must I do and use a method in call time result very slow and I'm used to datamapper style finder; there are any way for find whitout dynamic finder; I've tried it:
user=User.first(:name => "gaga") nice style datamapper
or
user=User.find(:first, :condition =>{:name => "gaga"}) ugly old rails version
but any work
thanks
The text was updated successfully, but these errors were encountered:
There is nothing wrong with calling User.find_by_email('[email protected]'). The warning just tells you that you probably want to define the view in the model so that it is obvious what views you have:
class User
view :by_email. :keys => [:email]
end
If you define the view you can ask the class what views are available, e.g. when you refresh all your views.
hi...this is a pretty noob question....when I use find_by_email I get:
Warning: Defining view User#by_email with keys "email" at call time, please add it to the class body...
I don't know what must I do and use a method in call time result very slow and I'm used to datamapper style finder; there are any way for find whitout dynamic finder; I've tried it:
user=User.first(:name => "gaga") nice style datamapper
or
user=User.find(:first, :condition =>{:name => "gaga"}) ugly old rails version
but any work
thanks
The text was updated successfully, but these errors were encountered: