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
Currently, the rspec2 branch of remarkable_activerecord has a modified have_scope that matches against the constructed Arel scopes. This is because everything is scoped, and turned into anonymous functions, and so it is difficult to get original conditions passed to Arel. However, Arel itself keeps track of this. The macros work by taking what you pass and constructing an Arel query from scratch, then comparing it with what was declare.
This works very well, however when it comes to printing it, it is very, very ugly. There is no pretty printer for Arel (and no, awesome_print does not actually pretty-print Arel objects). For the moment, I have expectation messages emit SQL instead. It is better than calling inspect on the Arel object, but not that much better.
This is not a huge priority for me, though it is more important if you are planning to print out specs for clients or using i18n. I'd appreciate some help with this part of the code, if anyone can come up with a good pretty-printer for Arel.
The text was updated successfully, but these errors were encountered:
Currently, the rspec2 branch of remarkable_activerecord has a modified have_scope that matches against the constructed Arel scopes. This is because everything is scoped, and turned into anonymous functions, and so it is difficult to get original conditions passed to Arel. However, Arel itself keeps track of this. The macros work by taking what you pass and constructing an Arel query from scratch, then comparing it with what was declare.
This works very well, however when it comes to printing it, it is very, very ugly. There is no pretty printer for Arel (and no, awesome_print does not actually pretty-print Arel objects). For the moment, I have expectation messages emit SQL instead. It is better than calling inspect on the Arel object, but not that much better.
This is not a huge priority for me, though it is more important if you are planning to print out specs for clients or using i18n. I'd appreciate some help with this part of the code, if anyone can come up with a good pretty-printer for Arel.
The text was updated successfully, but these errors were encountered: