AJFaraday / smiff_music

Social Media InterFace For Music - It's only a concept at this stage, the end-game is a situation where people can interact with a twitter account and music will result.
6 stars 1 forks source link

'clear all drums' message does not work #12

Closed 1bpm closed 9 years ago

1bpm commented 9 years ago

The message clear all drums returns I've cleared all of the drum patterns, but does not clear the overview or affect playback. There's no JS console output, but here is an extract from development.log:

Started POST "/messages" for 89.242.213.206 at 2015-01-04 20:06:28 -0500
Processing by MessagesController#create as JSON
Parameters: {"message"=>"clear all drums"}
MessageFormat Load (174.3ms)  SELECT `message_formats`.* FROM `message_formats`        
WHERE `message_formats`.`weight` = 2
(171.3ms)  BEGIN
SQL (174.9ms)  INSERT INTO `messages` (`action`, `created_at`, `message_format_id`,    
`parameters`, `source_text`, `status`, `updated_at`) VALUES ('clear_all_drums', '2015-01-05   
01:06:28', 2, '--- {}\n', 'clear all drums', 1, '2015-01-05 01:06:28')
(1076.9ms)  COMMIT
SQL (684.5ms)  UPDATE `patterns` SET `patterns`.`bits` = 0
(174.0ms)  BEGIN
SQL (173.8ms)  UPDATE `messages` SET `parameters` = '--- {}\n', `status` = 2, `updated_at` =  
'2015-01-05 01:06:30' WHERE `messages`.`id` = 36
(178.8ms)  COMMIT
Rendered text template (0.0ms)
Completed 200 OK in 2819ms (Views: 0.6ms | ActiveRecord: 2808.6ms)
AJFaraday commented 9 years ago

This was updating the database but not the in memory cache (reloading the page will enact these changes).

I've put in the fix for this, modifying the pattern store in the clear all action.