Commit 8cfd2e50
Changed files (2)
app
models
services
application
app/models/creation_repository.rb
@@ -1,4 +1,6 @@
class CreationRepository
+ delegate :find, to: :connection
+
def initialize(connection = Creation)
@connection = connection
end
@@ -11,4 +13,8 @@ class CreationRepository
def visible_creations
@connection.distinct.includes(:user).joins(:photos).where(is_restricted: false, 'photos.image_processing' => nil)
end
+
+ private
+
+ attr_reader :connection
end
app/services/application/find_creation_query.rb
@@ -1,5 +1,5 @@
class FindCreationQuery
- def initialize(repository = Creation)
+ def initialize(repository = CreationRepository.new)
@repository = repository
end