Module: LittleBrother::Record
- Defined in:
- lib/little_brother/record.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
3 4 5 |
# File 'lib/little_brother/record.rb', line 3 def self.included(base) base.send :before_filter, :record end |
Instance Method Details
#record ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/little_brother/record.rb', line 7 def record unless request.nil? begin w_user = defined?(watch_user) ? watch_user : "" Watcher.delay.create(:user_ip => request.remote_ip, :user => w_user, :params => params.to_s, :controller => controller_name, :action => action_name, :controller_action => controller_name+":"+action_name) rescue Exception Rails.logger.warn "[LittleBrother] Record couldnt be saved." end end end |