Sha256: 5d2a699c4557dee944cc95b9c8f2a5970cfc32cb66c3a90e50151d9c3777372b

Contents?: true

Size: 355 Bytes

Versions: 3

Compression:

Stored size: 355 Bytes

Contents

module TrackChanges
  module CurrentUserFilter #:nodoc:
    def self.filter(controller)
      controller.send(:__track_changes_to_models).each do |model|
        instance = controller.instance_variable_get("@#{model}")
        return if instance.nil?

        instance.current_user = controller.send(:current_user)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
track_changes-1.0.0.pre3 lib/track_changes/current_user_filter.rb
track_changes-1.0.0.pre2 lib/track_changes/current_user_filter.rb
track_changes-1.0.0.pre1 lib/track_changes/current_user_filter.rb