Closed lexruee closed 9 years ago
Commit c5c88e7af943749c93feee87a0b6dc1a63704286 closes this issue. The methods find_by and where are not removed, but should be refactored in the future using:
Facade::User.query do
User.all # just an example
end
# or
Facade::SportSession.query do
SportSession.all # just an example
end
I'm thinking of removing the class methods find_by and where in Facade::BaseFacade.
The reason is that Facade::BaseFacade can never mimic the rails fluent query api.
Currently the Facade cannot wrap such complex calls.
My solution to this problem: inversion of control using a block
This simplifies everyhting and we have less code in the Facade. Big advantage: you can use all rails query methods inside the query block. For me it seems to be a simple and proper solution.