Updated ItemsWithQuantities to work with MeasurementRoutine Replaced ColumnViews HABTM with polymorphic HMT Added Measurement notes Added destroy restrictions on Quantity Replaced BodyTrackingPluginController with Finders concern Removed 'body_trackers' prefix from paths Unified styling for textarea
8 lines
230 B
Ruby
8 lines
230 B
Ruby
module BodyTracking::TogglableColumns
|
|
# TODO: enforce 'domain' identity between quantites and receiving collection?
|
|
def toggle!(q)
|
|
column = find_by(quantity: q)
|
|
column ? destroy(column) : create(quantity: q)
|
|
end
|
|
end
|