mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 11:44:02 +00: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:
parent
9ca7421daf
commit
ddff97147f
1 changed files with 2 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue