Class: Charted::Visit
- Inherits:
-
Sequel::Model
- Object
- Sequel::Model
- Charted::Visit
- Includes:
- HasVisitor
- Defined in:
- lib/charted/model.rb
Instance Method Summary collapse
- #before_save ⇒ Object
-
#initialize(*args) ⇒ Visit
constructor
A new instance of Visit.
Methods included from HasVisitor
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_save ⇒ Object
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 |