mod/history/set/all/content_history.rb in card-1.94.1 vs mod/history/set/all/content_history.rb in card-1.95.0
- old
+ new
@@ -20,11 +20,11 @@
end
def save_content_draft content
super
acts.create do |act|
- act.actions.build(draft: true, card_id: id, action_type: :update)
+ act.ar_actions.build(draft: true, card_id: id, action_type: :update)
.card_changes.build(field: :db_content, value: content)
end
end
def last_change_on field, opts={}
@@ -143,10 +143,10 @@
end
def previous_action action_id
return unless action_id
action_index = actions.find_index { |a| a.id == action_id }
- actions[action_index - 1] if action_index.to_i.nonzero?
+ all_actions[action_index - 1] if action_index.to_i.nonzero?
end
def revised_at
(last_action && (act = last_action.act) && act.acted_at) || Time.zone.now
end