Module: Card::Set::Type::File::SelectedAction

Included in:
Card::Set::Type::File, Image
Defined in:
tmpsets/set/mod015-carrierwave/type/file.rb

Instance Method Summary collapse

Instance Method Details

#last_content_action_idObject



13
14
15
16
17
# File 'tmpsets/set/mod015-carrierwave/type/file.rb', line 13

def last_content_action_id
  return super if temporary_storage_type_change?
  # find action id from content (saves lookups)
  db_content.to_s.split(%r{[/\.]})[-2]
end

#select_action_by_params(params) ⇒ Object



7
8
9
10
11
# File 'tmpsets/set/mod015-carrierwave/type/file.rb', line 7

def select_action_by_params params
  # skip action table lookups for current revision
  rev_id = params[:rev_id]
  super unless rev_id && rev_id == last_content_action_id
end