Module: TouchRecords::ClassMethods
- Defined in:
- backend/app/model/mixins/touch_records.rb
Instance Method Summary collapse
Instance Method Details
#create_from_json(json, opts = {}) ⇒ Object
[View source]
41 42 43 44 45 |
# File 'backend/app/model/mixins/touch_records.rb', line 41 def create_from_json(json, opts = {}) obj = super touch(obj) obj end |
#touch(obj) ⇒ Object
[View source]
47 48 49 50 51 52 53 54 55 |
# File 'backend/app/model/mixins/touch_records.rb', line 47 def touch(obj) return unless obj.class.respond_to? :touch_records records = obj.class.touch_records(obj) yield if block_given? return unless records.any? records.each do |record_set| record_set[:type].update_mtime_for_ids(record_set[:ids].compact) end end |