Merge pull request #4674 from BrokenEagle/add-missing-associated-attributes
Add missing associated attributes
This commit is contained in:
@@ -35,8 +35,10 @@ class ApplicationController < ActionController::Base
|
||||
return
|
||||
end
|
||||
|
||||
model = options[0]&.delete(:model)
|
||||
if subject.respond_to?(:includes) && (request.format.json? || request.format.xml?)
|
||||
associations = ParameterBuilder.includes_parameters(params[:only], model_name)
|
||||
model ||= model_name
|
||||
associations = ParameterBuilder.includes_parameters(params[:only], model)
|
||||
subject = subject.includes(associations)
|
||||
end
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ class EmailsController < ApplicationController
|
||||
def index
|
||||
@email_addresses = authorize EmailAddress.visible(CurrentUser.user).paginated_search(params, count_pages: true)
|
||||
@email_addresses = @email_addresses.includes(:user)
|
||||
respond_with(@email_addresses)
|
||||
respond_with(@email_addresses, model: "EmailAddress")
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
Reference in New Issue
Block a user