Class: Ixtlan::Rails::TimestampsModifiedBy::Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/ixtlan/rails/timestamps_modified_by_filter.rb

Class Method Summary collapse

Class Method Details

.filter(controller) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ixtlan/rails/timestamps_modified_by_filter.rb', line 11

def self.filter(controller)
  name = controller.params[:controller]
  unless name.nil?
    parameters = controller.params[name.singular.to_sym]
    unless parameters.nil?
      parameters.delete(:created_at)
      parameters.delete(:created_on)
      parameters.delete(:created_by)
      # do not delete the updated_at so that optimistic persistence
      # can work !!!!
      #parameters.delete(:updated_at)
      parameters.delete(:updated_on)
      parameters.delete(:updated_by)
    end
  end
  yield if block_given?
end