1 # Filters added to this controller apply to all controllers in the application.
2 # Likewise, all the methods added will be available for all controllers.
4 class ApplicationController < ActionController::Base
5 helper :all # include all helpers, all the time
7 # See ActionController::RequestForgeryProtection for details
8 # Uncomment the :secret if you're not using the cookie session store
9 #protect_from_forgery :secret => '0fcc823b7dcd071c84967c35c10e155c'
10 before_filter :instantiate_controller_and_action_names
12 def instantiate_controller_and_action_names
13 @current_action = action_name
14 @current_controller = controller_name
17 def debug_message (message,is_not_error = true)
18 if true #Debug_message_on
21 p "> > > DEBUG ERROR:"
30 def add_stat(uid, action, extra = 0)
36 @stat = Stat.new(myParams)
42 debug_message ("STAT UPDATED: #{uid} installed application")
44 debug_message ("STAT UPDATED: #{uid} gave permission")
47 debug_message ("STAT UPDATED: #{uid} deleted application")
48 when ANSWERED_1QUESTION
49 debug_message ("STAT UPDATED: #{uid} answered on question")
51 debug_message ("STAT UPDATED: #{uid} tried to answer")
53 debug_message ("STAT UPDATED: #{uid} gave their code")
57 @source = "FROM_FB_ADS"
59 @source = "FROM_PLAY_ADS"
61 @source = "FROM_PLAY_SITE"
63 @source = "FROM_STATUS"
65 @source = "FROM_RESERVED"
68 debug_message ("STAT UPDATED: #{uid} came from #{@source}")