18 lines
279 B
Ruby
18 lines
279 B
Ruby
class Zap < ApplicationRecord
|
|
belongs_to :user
|
|
|
|
def request_event
|
|
nostr_event_from_hash(request)
|
|
end
|
|
|
|
def receipt_event
|
|
nostr_event_from_hash(receipt)
|
|
end
|
|
|
|
private
|
|
|
|
def nostr_event_from_hash(hash)
|
|
Nostr::Event.new(**hash.symbolize_keys)
|
|
end
|
|
end
|