Well, I canβt share this code, but I can point you in some direction. We used this stone in our application: https://github.com/collectiveidea/interactor .
I was very inspired by Martin's keynote, and the development of this application went pretty well :). In the case of separation of ActiveRecord and Business Logic, we did the following:
Each class in our business logic has something to do with the DatabaseEntity counterpart. This analogue used a different class - our adapter for ActiveRecord. He requested the appropriate ActiveRecord model and converted ActiveRecord instances to instances of our business logic classes.
In the end, most of the code was concentrated in this adapter.
source share