用户打分

This commit is contained in:
Wen 2014-05-06 15:15:29 +08:00
parent dc4e928741
commit d94e15cd94
5 changed files with 86 additions and 14 deletions

View File

@ -1,12 +1,12 @@
<h3>test</h3> <h3>test</h3>
<% users = User.all%> <% user = User.find(1)%>
<table> <table>
<tr> <tr>
<th>id</th><th>name</th><th>C</th><th>I</th><th>S</th><th>filecount</th><th>issuecount</th><th>level</th><th>attachconut</th> <th>id</th><th>name</th><th>C</th><th>I</th><th>S</th><th>filecount</th><th>issuecount</th><th>level</th><th>attachconut</th>
</tr> </tr>
<% users.each do |user| %>
@ -22,7 +22,7 @@
<td><%= calculate_attachments(user) %></td> <td><%= calculate_attachments(user) %></td>
</tr> </tr>
<% end %>
</table> </table>
<hr/> <hr/>

View File

@ -0,0 +1,5 @@
class DropUserScores < ActiveRecord::Migration
def change
drop_table :user_scores
end
end

View File

@ -0,0 +1,8 @@
class CreateUserLevels < ActiveRecord::Migration
def change
create_table :user_levels do |t|
t.integer :user_id
t.integer :level
end
end
end

View File

@ -0,0 +1,11 @@
class CreateUserScores < ActiveRecord::Migration
def change
create_table :user_scores do |t|
t.integer :user_id
t.integer :collaboration
t.integer :influence
t.integer :skill
t.integer :activity
end
end
end

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140428013546) do ActiveRecord::Schema.define(:version => 20140505083430) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -23,6 +23,15 @@ ActiveRecord::Schema.define(:version => 20140428013546) do
add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type"
add_index "activities", ["user_id"], :name => "index_activities_on_user_id" add_index "activities", ["user_id"], :name => "index_activities_on_user_id"
create_table "apply_project_masters", :force => true do |t|
t.integer "user_id"
t.string "apply_type"
t.integer "apply_id"
t.integer "status"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "attachments", :force => true do |t| create_table "attachments", :force => true do |t|
t.integer "container_id" t.integer "container_id"
t.string "container_type", :limit => 30 t.string "container_type", :limit => 30
@ -518,6 +527,14 @@ ActiveRecord::Schema.define(:version => 20140428013546) do
add_index "news", ["created_on"], :name => "index_news_on_created_on" add_index "news", ["created_on"], :name => "index_news_on_created_on"
add_index "news", ["project_id"], :name => "news_project_id" add_index "news", ["project_id"], :name => "news_project_id"
create_table "no_uses", :force => true do |t|
t.integer "user_id", :null => false
t.string "no_use_type"
t.integer "no_use_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "open_id_authentication_associations", :force => true do |t| create_table "open_id_authentication_associations", :force => true do |t|
t.integer "issued" t.integer "issued"
t.integer "lifetime" t.integer "lifetime"
@ -533,6 +550,19 @@ ActiveRecord::Schema.define(:version => 20140428013546) do
t.string "salt", :null => false t.string "salt", :null => false
end end
create_table "open_source_projects", :force => true do |t|
t.string "name"
t.text "description"
t.integer "commit_count", :default => 0
t.integer "code_line", :default => 0
t.integer "users_count", :default => 0
t.date "last_commit_time"
t.string "url"
t.date "date_collected"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "praise_tread_caches", :force => true do |t| create_table "praise_tread_caches", :force => true do |t|
t.integer "object_id", :null => false t.integer "object_id", :null => false
t.string "object_type" t.string "object_type"
@ -612,6 +642,24 @@ ActiveRecord::Schema.define(:version => 20140428013546) do
add_index "queries", ["project_id"], :name => "index_queries_on_project_id" add_index "queries", ["project_id"], :name => "index_queries_on_project_id"
add_index "queries", ["user_id"], :name => "index_queries_on_user_id" add_index "queries", ["user_id"], :name => "index_queries_on_user_id"
create_table "relative_memos", :force => true do |t|
t.integer "osp_id", :null => false
t.integer "parent_id"
t.string "subject", :null => false
t.text "content", :null => false
t.integer "author_id"
t.integer "replies_count", :default => 0
t.integer "last_reply_id"
t.boolean "lock", :default => false
t.boolean "sticky", :default => false
t.boolean "is_quote", :default => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "viewed_count_crawl", :default => 0
t.integer "viewed_count_local", :default => 0
t.string "url"
end
create_table "repositories", :force => true do |t| create_table "repositories", :force => true do |t|
t.integer "project_id", :default => 0, :null => false t.integer "project_id", :default => 0, :null => false
t.string "url", :default => "", :null => false t.string "url", :default => "", :null => false
@ -810,6 +858,11 @@ ActiveRecord::Schema.define(:version => 20140428013546) do
add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id"
add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id"
create_table "user_levels", :force => true do |t|
t.integer "user_id"
t.integer "level"
end
create_table "user_preferences", :force => true do |t| create_table "user_preferences", :force => true do |t|
t.integer "user_id", :default => 0, :null => false t.integer "user_id", :default => 0, :null => false
t.text "others" t.text "others"
@ -820,16 +873,11 @@ ActiveRecord::Schema.define(:version => 20140428013546) do
add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id"
create_table "user_scores", :force => true do |t| create_table "user_scores", :force => true do |t|
t.integer "user_id", :null => false t.integer "user_id"
t.integer "collaboration" t.integer "collaboration"
t.integer "influence" t.integer "influence"
t.integer "skill" t.integer "skill"
t.integer "active" t.integer "activity"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "level"
t.integer "file"
t.integer "issue"
end end
create_table "user_statuses", :force => true do |t| create_table "user_statuses", :force => true do |t|