diff options
| author | mo khan <mo@mokhan.ca> | 2014-05-17 21:47:38 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-05-17 21:47:38 -0600 |
| commit | 5cfd25f7380f1cbaa724ebae8fd86debd9892b28 (patch) | |
| tree | 0147a935b5ef6c82449648b03088f7ae920fd5e8 /app/controllers/api | |
| parent | abc7b7e193e3def61cef9e66892598200ff2e044 (diff) | |
extract a creations repository.
Diffstat (limited to 'app/controllers/api')
| -rw-r--r-- | app/controllers/api/v1/creations_controller.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/api/v1/creations_controller.rb b/app/controllers/api/v1/creations_controller.rb index c61bc615..101bf4f0 100644 --- a/app/controllers/api/v1/creations_controller.rb +++ b/app/controllers/api/v1/creations_controller.rb @@ -4,8 +4,13 @@ module Api before_filter :restrict_access respond_to :json + def initialize(repository = CreationRepository.new) + @repository = repository + super() + end + def index - @creations = Creation.visible_creations + @creations = @repository.visible_creations end private @@ -15,7 +20,6 @@ module Api User.exists?(:authentication_token => token) end end - end end end |
