Permalink
Browse files

update case switch for analytical_offering functions

  • Loading branch information...
1 parent a79891a commit 1b51f550d1cf20cb919cef276ee1627be426b612 Devin Gaffney committed Oct 22, 2010
Showing with 20 additions and 5 deletions.
  1. +9 −0 api/app/models/graph.rb
  2. +8 −3 back-end/cluster-code/analyzer/analysis_flow.rb
  3. +3 −2 front-end/db/schema.rb
@@ -152,6 +152,15 @@ def self.data_sort(title, graphs)
}
return graphs
when "user_gender_breakdown"
+ graphs.collect{|g|
+ if g.label == "0"
+ g.label = "inconclusive"
+ elsif g.label == "1"
+ g.label = "male"
+ elsif g.label == "2"
+ g.label = "female"
+ end
+ }
return graphs
end
end
@@ -210,9 +210,14 @@ def self.do_analysis_work
def self.route(metadata)
if Analysis.conditional(metadata.collection) != " where "
- case
- puts "#{metadata.function}(#{metadata.collection_id}, \"#{metadata.save_path}\")"
- eval("#{metadata.function}(#{metadata.collection_id}, \"#{metadata.save_path}\")")
+ case metadata.language
+ when "ruby"
+ puts "#{metadata.function}(#{metadata.collection_id}, \"#{metadata.save_path}\")"
+ eval("#{metadata.function}(#{metadata.collection_id}, \"#{metadata.save_path}\")")
+ when "python"
+ puts "#{metadata.function}(#{metadata.collection_id}, \"#{metadata.save_path}\")"
+ `python analyzer/tools/#{metadata.function}.py -collection_id #{metdata.collection_id} -save_path #{metadata.save_path}`
+ end
else
Analysis.remove_broken_collections(metadata.collection)
end
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20101022173305) do
+ActiveRecord::Schema.define(:version => 20101022181838) do
create_table "analysis_metadatas", :force => true do |t|
t.boolean "finished", :default => false, :null => false
@@ -45,6 +45,7 @@
t.boolean "enabled", :default => false, :null => false
t.string "save_path"
t.string "access_level"
+ t.string "language"
end
create_table "auth_users", :force => true do |t|
@@ -212,7 +213,7 @@
t.boolean "share_email", :default => false, :null => false
t.boolean "private_data", :default => false, :null => false
t.boolean "hidden_account", :default => false, :null => false
- t.boolean "rate_limited"
+ t.boolean "rate_limited", :default => false
end
create_table "rest_instances", :force => true do |t|

0 comments on commit 1b51f55

Please sign in to comment.