Attempting to find a good way to give a wrapper around AR objects to give them Repository pattern effects.
-
Do validations stay on the ActiveRecord model or do they move to the Repository object?
-
Is delegating attributes / errors / finders to the AR object bad?
For example: UserRepository.new.errors => Calls user.errors ?
-
When calling associations (User => Comments), does the Repository return CommentRepository objects, or Comment objects?
-
Are we giving the view a repository object, or a ValueObject, which could be a decorator / presenter object since they're immutable.
AR and repositories are fundamentally different, trying to use it this way is just gonna lead to pain.