Class: Searchjoy::Search

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/searchjoy/search.rb

Instance Method Summary collapse

Instance Method Details

#convert(convertable = nil) ⇒ Object



12
13
14
15
16
17
18
# File 'app/models/searchjoy/search.rb', line 12

def convert(convertable = nil)
  unless converted?
    self.converted_at = Time.now
    self.convertable = convertable
    save(validate: false)
  end
end

#converted?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'app/models/searchjoy/search.rb', line 20

def converted?
  converted_at.present?
end