summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin/users_controller.rb10
-rw-r--r--app/controllers/creation_tags_controller.rb8
2 files changed, 11 insertions, 7 deletions
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index f2386854..abc33286 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -1,20 +1,20 @@
module Admin
class UsersController < AdminController
- def initialize(users_repository = Spank::IOC.resolve(:users))
- @users_repository = users_repository
+ def initialize(repository = Spank::IOC.resolve(:users))
+ @repository = repository
super()
end
def index
- @users = users_repository.search_by(params[:q])
+ @users = repository.search_by(params[:q])
end
def show
- @user = users_repository.includes(creations: :photos).find(params[:id])
+ @user = repository.includes(creations: :photos).find(params[:id])
end
private
- attr_reader :users_repository
+ attr_reader :repository
end
end
diff --git a/app/controllers/creation_tags_controller.rb b/app/controllers/creation_tags_controller.rb
index b11ff867..8b71d8ab 100644
--- a/app/controllers/creation_tags_controller.rb
+++ b/app/controllers/creation_tags_controller.rb
@@ -1,10 +1,14 @@
class CreationTagsController < ApplicationController
+ def initialize(repository = Spank::IOC.resolve(:cakes))
+ @repository = repository
+ end
+
def index
- @tags = Creation.tag_counts_on(:tags)
+ @tags = @repository.tag_counts_on(:tags)
end
def show
@tag = params[:id].downcase.parameterize
- @creations = Creation.tagged(@tag).page(params[:page]).per(12)
+ @creations = @repository.tagged(@tag).page(params[:page]).per(12)
end
end