Module: GBDev::CallbackLogger::ClassMethods
- Defined in:
- lib/callback_logger.rb
Instance Attribute Summary collapse
-
#callback_logger_except ⇒ Object
The text used to use for this entry.
-
#callback_logger_model ⇒ Object
The text used to use for this entry.
-
#callback_logger_object_url ⇒ Object
The text used to use for this entry.
-
#callback_logger_only ⇒ Object
The text used to use for this entry.
-
#callback_logger_text_attr ⇒ Object
The text used to use for this entry.
Instance Method Summary collapse
Instance Attribute Details
#callback_logger_except ⇒ Object
The text used to use for this entry. (ie user name). If not set the id will be used.
11 12 13 |
# File 'lib/callback_logger.rb', line 11 def callback_logger_except @callback_logger_except end |
#callback_logger_model ⇒ Object
The text used to use for this entry. (ie user name). If not set the id will be used.
11 12 13 |
# File 'lib/callback_logger.rb', line 11 def callback_logger_model @callback_logger_model end |
#callback_logger_object_url ⇒ Object
The text used to use for this entry. (ie user name). If not set the id will be used.
11 12 13 |
# File 'lib/callback_logger.rb', line 11 def callback_logger_object_url @callback_logger_object_url end |
#callback_logger_only ⇒ Object
The text used to use for this entry. (ie user name). If not set the id will be used.
11 12 13 |
# File 'lib/callback_logger.rb', line 11 def callback_logger_only @callback_logger_only end |
#callback_logger_text_attr ⇒ Object
The text used to use for this entry. (ie user name). If not set the id will be used.
11 12 13 |
# File 'lib/callback_logger.rb', line 11 def callback_logger_text_attr @callback_logger_text_attr end |
Instance Method Details
#log_callbacks(*args) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/callback_logger.rb', line 17 def log_callbacks(*args) = {:text => '', :object_url => {}, :aacl_model => 'AppLog', :only => [], :except => []} .merge!(args.pop) unless args.empty? self.callback_logger_text_attr = .delete(:text).to_sym unless [:text].blank? self.callback_logger_object_url = .delete(:object_url) mod = .delete(:aacl_model).titleize.gsub(' ','') mod = ActiveSupport::Inflector.camelize(mod).constantize self.callback_logger_model = mod self.callback_logger_only = .delete(:only) self.callback_logger_except = .delete(:except) extend GBDev::CallbackLogger::SingletonMethods include GBDev::CallbackLogger::InstanceMethods class_eval do after_create :log_create after_update :log_update after_destroy :log_destroy end # class_eval end |