Scope Methods, Metaprogramming
Building scope methods was one of the more challenging (and more rewarding) aspects of building my rails project.The first one was straightforward - in the form to create a new wine, users could mark a wine as 'favorite'. The goal was to query the database using Active Record query interface and return an array of favorite wines. The where method was the best fit, since I wanted to return multiple objects.
Scope Methods, Metaprogramming #ruby #rails #rubyonrails #bosnia #programming #tutorials #rubydeveloper #railsdeveloper