Module: Socialization::Stores::Mixins::Base
- Included in:
- ActiveRecordStores::Follow, ActiveRecordStores::Like, ActiveRecordStores::Mention, RedisStores::Follow, RedisStores::Like, RedisStores::Mention
- Defined in:
- lib/socialization/stores/mixins/base.rb
Instance Method Summary collapse
- #touch_actor?(actor) ⇒ Boolean
- #touch_dependents(actor, subject) ⇒ Object
- #touch_subject?(subject) ⇒ Boolean (also: #touch_victim?)
Instance Method Details
#touch_actor?(actor) ⇒ Boolean
10 11 12 13 |
# File 'lib/socialization/stores/mixins/base.rb', line 10 def touch_actor?(actor) return false unless actor.respond_to?(:touch) touch == :all || touch.to_s =~ /er$/i end |
#touch_dependents(actor, subject) ⇒ Object
5 6 7 8 |
# File 'lib/socialization/stores/mixins/base.rb', line 5 def touch_dependents(actor, subject) actor.touch if touch_actor?(actor) subject.touch if touch_subject?(subject) end |
#touch_subject?(subject) ⇒ Boolean Also known as: touch_victim?
15 16 17 18 |
# File 'lib/socialization/stores/mixins/base.rb', line 15 def touch_subject?(subject) return false unless subject.respond_to?(:touch) touch == :all || touch.to_s =~ /able$/i end |