Skip to content

Add citations in bulk

Gareth Rees edited this page Jul 25, 2024 · 2 revisions
me = User.find(USER_ID)
uri = 'https://example.com'
ctype = 'journalism academic campaigning other' # pick one

# info_requests = InfoRequest.where…

info_requests.each { |ir| ir.citations.create!(user: me, source_url: uri, type: ctype) }
Clone this wiki locally