Sha256: b7bad0c5eb93d2780ef69e94b39d0f3f2d547e8ee19c302a959afd1a8bca01d1
Contents?: true
Size: 1.84 KB
Versions: 2
Compression:
Stored size: 1.84 KB
Contents
# -*- encoding : utf-8 -*- class Card; module Set; class All; module History; # Set: All cards (History, Selected) # # if these aren't in a nested module, the methods just overwrite the base # methods, but we need a distinct module so that super will be able to refer to module Selected; extend Card::Set def self.source_location; "/Users/ethan/dev/decko/gem/card-mod-history/set/all/history/selected.rb"; end # the base methods. def content @selected_action_id ? selected_content : super end def content= value @selected_content = nil super end def select_action_by_params params action = nth_action(params[:rev]) || action_from_id(params[:rev_id]) return unless action select_action action.id end def select_action action_id run_callbacks :select_action do self.selected_action_id = action_id end end def selected_action_id @selected_action_id || @current_action&.id || last_action_id end def selected_action_id= action_id @selected_content = nil @selected_action_id = action_id end def selected_action selected_action_id && Action.fetch(selected_action_id) end def selected_content @selected_content ||= content_at_time_of_selected_action || db_content end def content_at_time_of_selected_action last_change_on(:db_content, not_after: selected_action_id, including_drafts: true)&.value end def with_selected_action_id action_id current_action_id = @selected_action_id select_action_id action_id result = yield select_action_id current_action_id result end def select_action_id action_id run_callbacks :select_action do self.selected_action_id = action_id end end def selected_content_action_id @selected_action_id || new_content_action_id || last_content_action_id end end;end;end;end;end; # ~~ generated from /Users/ethan/dev/decko/gem/card-mod-history/set/all/history/selected.rb ~~
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
card-1.101.7 | tmpsets/set/mod012-card-mod-history/all/history/selected.rb |
card-1.101.6 | tmpsets/set/mod012-card-mod-history/all/history/selected.rb |