optimization

This commit is contained in:
Andrew Brown 2018-09-10 03:00:29 -05:00
parent 78153ec126
commit 67bbb6fbe8

View File

@ -10,7 +10,7 @@ module HasChangelog
ContentChangeEvent.where(
content_id: id,
content_type: self.class.name
).order(:id)
).includes(:user).order(:id)
end
def attribute_change_events(limit=100)
@ -20,7 +20,7 @@ module HasChangelog
entity_id: id
),
content_type: "Attribute"
).order(:id).last(limit)
).includes(:user).order(:id).last(limit)
end
after_create do