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

Included in:
Card::Set::Type::File, Image
Defined in:
platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb

Instance Method Summary collapse

Instance Method Details

#last_content_action_idObject



17
18
19
20
21
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb', line 17

def last_content_action_id
  # find action id from content (saves lookups)
  aid = db_content.to_s.split(%r{[/.]})[-2]
  aid.number? ? aid.to_i : nil
end

#select_action_by_params(params) ⇒ Object



11
12
13
14
15
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb', line 11

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