diff --git a/app/controllers/admin/teams/members_controller.rb b/app/controllers/admin/teams/members_controller.rb index e7dbcad568f66c4e304a73f9e07cc26c00d16537..e64698744190c5665f81c3296a771d6f3a79adc0 100644 --- a/app/controllers/admin/teams/members_controller.rb +++ b/app/controllers/admin/teams/members_controller.rb @@ -1,7 +1,7 @@ class Admin::Teams::MembersController < Admin::Teams::ApplicationController def new @users = User.potential_team_members(user_team) - @users = UserDecorator.decorate @users + @users = UserDecorator.decorate_collection @users end def create diff --git a/app/controllers/commits_controller.rb b/app/controllers/commits_controller.rb index 534ae1edd3136df5f81949c582d930ad617eb866..9dc0d96883e3351082497b7bd8ed6b863aa10e0f 100644 --- a/app/controllers/commits_controller.rb +++ b/app/controllers/commits_controller.rb @@ -13,7 +13,7 @@ def show @limit, @offset = (params[:limit] || 40), (params[:offset] || 0) @commits = @repo.commits(@ref, @path, @limit, @offset) - @commits = CommitDecorator.decorate(@commits) + @commits = CommitDecorator.decorate_collection(@commits) respond_to do |format| format.html # index.html.erb diff --git a/app/controllers/compare_controller.rb b/app/controllers/compare_controller.rb index ae20f9c0ba6dd0a62b28721060318aec056b1344..bd3f111517366c4183b1e9cb77e49c540939f60d 100644 --- a/app/controllers/compare_controller.rb +++ b/app/controllers/compare_controller.rb @@ -16,7 +16,7 @@ def show @refs_are_same = result[:same] @line_notes = [] - @commits = CommitDecorator.decorate(@commits) + @commits = CommitDecorator.decorate_collection(@commits) end def create diff --git a/app/controllers/merge_requests_controller.rb b/app/controllers/merge_requests_controller.rb index c8fe2e6bfe8a0bb863440fdc49d435e9f5a4e44c..9992e9b81e0d74e8756ffda951b80a06110f5f90 100644 --- a/app/controllers/merge_requests_controller.rb +++ b/app/controllers/merge_requests_controller.rb @@ -94,12 +94,12 @@ def automerge def branch_from @commit = @repository.commit(params[:ref]) - @commit = CommitDecorator.decorate(@commit) + @commit = CommitDecorator.decorate_collection(@commit) end def branch_to @commit = @repository.commit(params[:ref]) - @commit = CommitDecorator.decorate(@commit) + @commit = CommitDecorator.decorate_collection(@commit) end def ci_status @@ -143,7 +143,7 @@ def define_show_vars # Get commits from repository # or from cache if already merged @commits = @merge_request.commits - @commits = CommitDecorator.decorate(@commits) + @commits = CommitDecorator.decorate_collection(@commits) @allowed_to_merge = allowed_to_merge? @show_merge_controls = @merge_request.opened? && @commits.any? && @allowed_to_merge diff --git a/app/controllers/teams/members_controller.rb b/app/controllers/teams/members_controller.rb index ead62e13afac8a6f8f8790eaf088f49ffb01b417..4bd70fd7247e6b020b9039738b0f78f1e9bccc15 100644 --- a/app/controllers/teams/members_controller.rb +++ b/app/controllers/teams/members_controller.rb @@ -8,7 +8,7 @@ def index def new @users = User.potential_team_members(user_team) - @users = UserDecorator.decorate @users + @users = UserDecorator.decorate_collection @users end def create diff --git a/app/decorators/application_decorator.rb b/app/decorators/application_decorator.rb index 3023699e7004fce9813d7d40317c3a4ba68cdcbc..b805b3479b84c4f39db83644217a7a323818b7d7 100644 --- a/app/decorators/application_decorator.rb +++ b/app/decorators/application_decorator.rb @@ -1,27 +1,28 @@ -class ApplicationDecorator < Draper::Base +class ApplicationDecorator < Draper::Decorator + delegate_all # Lazy Helpers # PRO: Call Rails helpers without the h. proxy # ex: number_to_currency(model.price) # CON: Add a bazillion methods into your decorator's namespace # and probably sacrifice performance/memory - # + # # Enable them by uncommenting this line: # lazy_helpers # Shared Decorations # Consider defining shared methods common to all your models. - # + # # Example: standardize the formatting of timestamps # # def formatted_timestamp(time) - # h.content_tag :span, time.strftime("%a %m/%d/%y"), - # class: 'timestamp' + # h.content_tag :span, time.strftime("%a %m/%d/%y"), + # class: 'timestamp' # end - # + # # def created_at # formatted_timestamp(model.created_at) # end - # + # # def updated_at # formatted_timestamp(model.updated_at) # end