Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- delete_heard_timeline_event(current_user.id, @showable_video.user.id, @showable_video.video.id)
- def delete_heard_timeline_event(actor_id, subject_id, secondary_subject_id)
- TimelineEvent.find_by_actor_id_and_subject_id_and_secondary_subject_id_and_event_type(actor_id, subject_id, secondary_subject_id, 'heard_event').destroy
- end
- a = YourModelName.new
- a.delete_heard_timeline_event(your_parameters)
- YourModelName.delete_heard_timeline_event(your_parameters)
- find_by_actor_id_and_subject_id_and_secondary_subject_id_and_event_type
- class TimelineEvent
- def self.delete_heard_event(actor_id, subject_id, sec_id)
- self.scoped.where(:actor_id => actor_id,
- :subject_id => subject_id,
- :secondary_subject_id => sec_id,
- :event_type => 'heard_event').first.try(:destroy)
- end
- end
- TimelineEvent.delete_heard_event(current_user.id, @showable_video.user.id, @showable_video.video.id)
Add Comment
Please, Sign In to add comment