Class: Ahoy::EventsController

Inherits:
BaseController show all
Defined in:
app/controllers/ahoy/events_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



4
5
6
7
8
9
10
11
# File 'app/controllers/ahoy/events_controller.rb', line 4

def create
  options = {}
  if params[:time] and (time = Time.at(params[:time].to_f) rescue nil) and (1.minute.ago..Time.now).cover?(time)
    options[:time] = time
  end
  ahoy.track params[:name], params[:properties], options
  render json: {}
end