1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
body_tracking/lib/body_tracking/togglable_exposures.rb
cryptogopher a4781b4fcd Renamed: column -> exposure
Moved toggle_column_options to body_trackers helper
2020-04-25 15:42:22 +02:00

8 lines
238 B
Ruby

module BodyTracking::TogglableExposures
# TODO: enforce 'domain' identity between quantites and receiving collection?
def toggle!(q)
exposure = find_by(quantity: q)
exposure ? destroy(exposure) : create(quantity: q)
end
end