Sha256: b5491e17d74d54ceb4615087fc0122b4cecb8b68989021557fb95efcc39ab736

Contents?: true

Size: 516 Bytes

Versions: 30

Compression:

Stored size: 516 Bytes

Contents

event :discard_deleted_locations, :finalize, on: :delete do
  Env.discard_locations_for self
  configure_successful_deletion if success.target == self
end

event :save_current_location, before: :show_page, on: :read do
  Env.save_location self
end

# TO DISCUSS: should this default behavior be directly in the controller?
# Or at least in decko?
def configure_successful_deletion
  if Env.ajax?
    success.card = self
    success.view = :unknown unless success.view
  else
    success.target = :previous
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
card-mod-session-0.18.1 set/all/location_history.rb
card-mod-session-0.18.0 set/all/location_history.rb
card-mod-session-0.17.0 set/all/location_history.rb
card-mod-session-0.16.0 set/all/location_history.rb
card-mod-session-0.15.6 set/all/location_history.rb
card-mod-session-0.15.5 set/all/location_history.rb
card-mod-session-0.15.4 set/all/location_history.rb
card-mod-session-0.15.3 set/all/location_history.rb
card-mod-session-0.15.2.pre1 set/all/location_history.rb
card-mod-session-0.15.1.1 set/all/location_history.rb
card-mod-session-0.15.1 set/all/location_history.rb
card-mod-session-0.15.0 set/all/location_history.rb
card-mod-session-0.14.2 set/all/location_history.rb
card-mod-session-0.14.1 set/all/location_history.rb
card-mod-session-0.14.0 set/all/location_history.rb
card-mod-session-0.13.4 set/all/location_history.rb
card-mod-session-0.13.3 set/all/location_history.rb
card-mod-session-0.13.2 set/all/location_history.rb
card-mod-session-0.13.1 set/all/location_history.rb
card-mod-session-0.13.0 set/all/location_history.rb