mirror of
https://github.com/openSUSE/osem.git
synced 2026-05-19 14:11:52 -04:00
Query versions of associations
Not association related versions data. To make this database save, this broke with Postgre. Probably LIKE vs ILIKE...
This commit is contained in:
@@ -45,10 +45,8 @@ module Admin
|
||||
@votes = @event.votes.includes(:user)
|
||||
@difficulty_levels = @program.difficulty_levels
|
||||
@versions = @event.versions |
|
||||
PaperTrail::Version.where(item_type: 'Commercial').where('object LIKE ?', "%commercialable_id: #{@event.id}\ncommercialable_type: Event%") |
|
||||
PaperTrail::Version.where(item_type: 'Commercial').where('object_changes LIKE ?', "%commercialable_id:\n- \n- #{@event.id}\ncommercialable_type:\n- \n- Event%") |
|
||||
PaperTrail::Version.where(item_type: 'Vote').where('object_changes LIKE ?', "%\nevent_id:\n- \n- #{@event.id}\n%") |
|
||||
PaperTrail::Version.where(item_type: 'Vote').where('object LIKE ?', "%\nevent_id: #{@event.id}\n%")
|
||||
@event.commercials.map(&:versions).flatten |
|
||||
@event.votes.map(&:versions).flatten
|
||||
end
|
||||
|
||||
def edit
|
||||
|
||||
Reference in New Issue
Block a user