Class: Charted::Visit

Inherits:
Sequel::Model
  • Object
show all
Includes:
HasVisitor
Defined in:
lib/charted/model.rb

Instance Method Summary collapse

Methods included from HasVisitor

#site

Constructor Details

#initialize(*args) ⇒ Visit

Returns a new instance of Visit.



119
120
121
122
# File 'lib/charted/model.rb', line 119

def initialize(*args)
  super
  self.created_at ||= DateTime.now
end

Instance Method Details

#before_saveObject



124
125
126
127
# File 'lib/charted/model.rb', line 124

def before_save
  self.search_terms = URI.parse(self.referrer).search_string if self.referrer.to_s !~ /^\s*$/
  super
end