1
0

61 Commits

Author SHA1 Message Date
cryptogopher
9d19890f6f Extracted quantity value resolving to Formula#resolve 2020-05-08 15:46:38 +02:00
cryptogopher
8d6aafd6ef Model method calls should be indexed 2020-05-06 23:01:17 +02:00
cryptogopher
9c3d31c131 Fixes for formula computation
Added default quantity
2020-05-05 22:02:48 +02:00
cryptogopher
8749710330 Formula can contain model method calls 2020-05-05 01:52:34 +02:00
cryptogopher
4230d72206 compute_quantities now returns single hash
Fixed MeasurementsController view management
2020-04-26 20:21:17 +02:00
cryptogopher
9f5f31ca42 Indexing by item, not item.id 2020-04-25 23:28:24 +02:00
cryptogopher
c24bdd6f45 Renamed: formula_q -> filter_q
Added Meal related associations to Project
2020-04-25 22:49:48 +02:00
cryptogopher
c029ba59c2 Fixed saving Meal exposures
According to:
https://stackoverflow.com/questions/34328735/imageable-type-is-not-setting-for-polymorphic-associations
and
https://stackoverflow.com/questions/2494452/rails-polymorphic-association-with-multiple-associations-on-the-same-model
2020-04-25 18:07:58 +02:00
cryptogopher
ab8ed92929 Added MealsController#toggle_exposure 2020-04-25 15:52:35 +02:00
cryptogopher
a4781b4fcd Renamed: column -> exposure
Moved toggle_column_options to body_trackers helper
2020-04-25 15:42:22 +02:00
cryptogopher
e78803e474 Added MealsController#new and form autocomplete for Food
Renamed QuantityColumn -> Exposure
2020-04-15 23:42:58 +02:00
cryptogopher
8e8160c41a Renamed Ingredient -> Food
Ingredient is now part of composition (meal/recipe/dish)
2020-04-14 19:44:19 +02:00
cryptogopher
c3010a70e8 Adding Meals, WIP 2020-04-13 15:36:59 +02:00
cryptogopher
ced06a25bc Added :meals and :compositions_ingredients tables
Changed Column -> QuantityColumn
Updated :ingredients table to handle recipes
2020-04-13 01:11:34 +02:00
cryptogopher
8882385dfa Removed :scope filter 2020-03-29 18:06:53 +02:00
cryptogopher
18419f1aeb Added MeasurementRoutine as a nested Measurement model
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
2020-03-29 00:56:37 +01:00
cryptogopher
e7a33c684f Dispplaying units of computed values
Fixed formula error messages display when filter formula not given
2020-03-25 23:07:59 +01:00
cryptogopher
6919f9910c Changed indexing from q_name -> q in compute 2020-03-24 21:59:57 +01:00
cryptogopher
cfe225c014 Filters zero_nil setting and computing fixed 2020-03-24 01:54:26 +01:00
cryptogopher
08ac719566 Fixes after introducing Formula model 2020-03-24 00:53:02 +01:00
cryptogopher
10325c9c39 Added zero_nil to Ingredients filter formula
Displaying formulas errors for Nutrients view
Substituted onblur for Ingredients filters with hidden submit
2020-03-22 01:02:37 +01:00
cryptogopher
c3b783e942 Displaying errors for uncomputable formulas in nutrients view 2020-03-21 00:38:39 +01:00
cryptogopher
320fe93388 Fixed references to formula as model 2020-03-10 22:17:20 +01:00
cryptogopher
2d778c831b Introduced plugin layout instead of using Redmine ViewListener render_on 2020-02-22 22:39:12 +01:00
cryptogopher
4e537f3981 Moved Formula to separate model 2020-02-16 18:34:07 +01:00
cryptogopher
aa26e66312 Fixed calculation for indexed formulas
Delegated Quantity formula calls
2020-02-04 00:13:49 +01:00
cryptogopher
df8703ba3c Updated Formula::calculate to use FormulaBuilder 2020-01-27 00:59:33 +01:00
cryptogopher
98207fc980 Added Formula test vectors
Improved FormulaBuilder based on vectors
2020-01-25 21:51:03 +01:00
cryptogopher
ba4c98e213 Added Formula unit test 2020-01-24 01:05:59 +01:00
cryptogopher
8d0f6eec81 Moved FormulaBuilder to Formula module 2020-01-24 00:17:00 +01:00
cryptogopher
9803b31f78 Integarted FormulaBuilder into Formula 2020-01-22 22:54:54 +01:00
cryptogopher
b437bee18b Optimized formula computation to run 'eval' once 2020-01-11 23:49:30 +01:00
cryptogopher
20deb944c3 Updated Ingredients to use ItemsWithQuantities 2019-12-29 15:12:05 +01:00
cryptogopher
530dba0612 ColumnView fixes 2019-12-21 12:18:31 +01:00
cryptogopher
0c0ca1d286 Replaced Quantity 'primary' attr with ColumnView model 2019-12-14 23:56:36 +01:00
cryptogopher
925def1674 Displaying readouts is working 2019-12-14 01:25:20 +01:00
cryptogopher
96fe7db39d Moved filter/compute to separate module
Converting it to model independent code, WIP
2019-12-12 00:13:30 +01:00
cryptogopher
e7ede4cce6 Implemented retake, changed default ordering to taken_at 2019-12-06 23:35:49 +01:00
cryptogopher
22aeda720d Measurement/readouts WIP 2019-11-16 18:39:46 +01:00
cryptogopher
3ce5d5c940 Fix migration of default quantities
Allow Quantity formula to be nil but not blank
Add computed energy quantity
Reverse default quantities deletion order
2019-11-15 00:04:34 +01:00
cryptogopher
dc9ebb36f6 Simplified Formula.valid? 2019-11-11 15:46:57 +01:00
cryptogopher
2e477921e9 Updated Formula get_quantities/calculate for new parsing algo 2019-11-11 15:10:02 +01:00
cryptogopher
613c26728c Removed old (Ripper.lex based) formula validation code
Muted multiple 'disallowed' messages for keywords
Removed unnecessary .to_d call in formula computation
2019-11-11 00:01:31 +01:00
cryptogopher
d768adb86b Formula parsing extensions 2019-11-10 23:37:11 +01:00
cryptogopher
13703dc8ed Fixed filtering 2019-11-10 23:23:59 +01:00
cryptogopher
60cfd17c0f WIP on alternative (sexp) formula parsing 2019-11-10 23:14:36 +01:00
cryptogopher
841fcb2807 Working on formula validation to accomodate functions, WIP 2019-11-10 00:48:54 +01:00
cryptogopher
67b0cd9b66 Unevaluable formulas return nil (instead of throwing error)
Filter formula errors are shown in filter view
2019-11-09 20:36:10 +01:00
cryptogopher
70b6e97b87 Filtering ingredients by formula working 2019-11-08 23:42:41 +01:00
cryptogopher
78cf471ecd Preliminary support for comparison formula 2019-11-07 19:55:16 +01:00