Commit 8cfd2e50

mo khan <mo@mokhan.ca>
2014-05-18 04:15:20
replace another usage of Creation with CreationRepository.
1 parent 5cfd25f
Changed files (2)
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