Sha256: 8ccd86784d54f6c313ec72f0954adf57f5c09eab0dc9ac3c39a57a2893a90be7

Contents?: true

Size: 603 Bytes

Versions: 4

Compression:

Stored size: 603 Bytes

Contents

module Socialization
  module Stores
    module Mixins
      module Base
        def touch_dependents(actor, subject)
          actor.touch if touch_actor?(actor)
          subject.touch if touch_subject?(subject)
        end

        def touch_actor?(actor)
          return false unless actor.respond_to?(:touch)
          touch == :all || touch.to_s =~ /er$/i
        end

        def touch_subject?(subject)
          return false unless subject.respond_to?(:touch)
          touch == :all || touch.to_s =~ /able$/i
        end
        alias touch_victim? touch_subject?
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
socialization-2.0.2 lib/socialization/stores/mixins/base.rb
socialization-2.0.1 lib/socialization/stores/mixins/base.rb
socialization-2.0.0 lib/socialization/stores/mixins/base.rb
socialization-1.2.3 lib/socialization/stores/mixins/base.rb