From aa19d59914aeffc70043bd05b1f2226d2799fe49 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 16 Feb 2013 16:10:45 -0500 Subject: [PATCH 1/3] limit to 1 genre --- lib/jam_ruby/constants/limits.rb | 2 +- spec/jam_ruby/models/recording_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/jam_ruby/constants/limits.rb b/lib/jam_ruby/constants/limits.rb index fc7158b10..5d5e409d0 100644 --- a/lib/jam_ruby/constants/limits.rb +++ b/lib/jam_ruby/constants/limits.rb @@ -6,7 +6,7 @@ module Limits # recording genres MIN_GENRES_PER_RECORDING = 1 - MAX_GENRES_PER_RECORDING = 3 + MAX_GENRES_PER_RECORDING = 1 # instruments MIN_INSTRUMENTS_PER_MUSICIAN = 1 diff --git a/spec/jam_ruby/models/recording_spec.rb b/spec/jam_ruby/models/recording_spec.rb index 76c5d9e10..62a529f50 100644 --- a/spec/jam_ruby/models/recording_spec.rb +++ b/spec/jam_ruby/models/recording_spec.rb @@ -86,10 +86,10 @@ describe Recording do @genre2 = FactoryGirl.create(:genre) @genre3 = FactoryGirl.create(:genre) - @recording.update_fields :name => "name1", :description => "description", :genres => [@genre1, @genre2], :is_downloadable => true, :is_public => true + @recording.update_fields :name => "name1", :description => "description", :genres => [@genre1], :is_downloadable => true, :is_public => true @recording.name.should == "name1" @recording.description.should == "description" - @recording.genres.length.should == 2 + @recording.genres.length.should == 1 @recording.is_public.should == true @recording.is_downloadable.should == true From 1b62522ce36580520679eabce5646b963e0237df Mon Sep 17 00:00:00 2001 From: Jonathan Kolyer Date: Thu, 21 Feb 2013 11:36:58 -0600 Subject: [PATCH 2/3] vrfs192: added stale_connection_client_ids and flag_connection_stale_with_client_ids to allow websocket-gateway ability to cleanup when stale connection is deleted --- lib/jam_ruby/connection_manager.rb | 36 +++++++++++++++--------- spec/jam_ruby/connection_manager_spec.rb | 7 +++-- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/lib/jam_ruby/connection_manager.rb b/lib/jam_ruby/connection_manager.rb index 3a2cd424f..4df6916fd 100644 --- a/lib/jam_ruby/connection_manager.rb +++ b/lib/jam_ruby/connection_manager.rb @@ -26,6 +26,17 @@ module JamRuby #TODO end + def flag_connection_stale_with_client_id(client_id) + sql =< Date: Thu, 21 Feb 2013 19:34:04 -0600 Subject: [PATCH 3/3] added reconnect method --- lib/jam_ruby/connection_manager.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/jam_ruby/connection_manager.rb b/lib/jam_ruby/connection_manager.rb index 4df6916fd..a4f8f2cad 100644 --- a/lib/jam_ruby/connection_manager.rb +++ b/lib/jam_ruby/connection_manager.rb @@ -26,6 +26,16 @@ module JamRuby #TODO end + def reconnect(conn) + sql =<