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



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

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

#converted?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/models/searchjoy/search.rb', line 18

def converted?
  converted_at.present?
end