Conflicts: Gemfile app/views/homework_attach/new.html.erb app/views/layouts/base_newcontest.html.erb public/stylesheets/jstoolbar.cssdev_dingxu
commit
3ee1f0483f
@ -1,125 +1,249 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
unless RUBY_PLATFORM =~ /w32/
|
unless RUBY_PLATFORM =~ /w32/
|
||||||
|
5
|
||||||
# unix-like only
|
# unix-like only
|
||||||
|
6
|
||||||
gem 'iconv'
|
gem 'iconv'
|
||||||
|
7
|
||||||
gem 'rubyzip'
|
gem 'rubyzip'
|
||||||
|
8
|
||||||
gem 'zip-zip'
|
gem 'zip-zip'
|
||||||
|
9
|
||||||
end
|
end
|
||||||
|
10
|
||||||
|
11
|
||||||
gem 'seems_rateable', path: 'lib/seems_rateable'
|
gem 'seems_rateable', path: 'lib/seems_rateable'
|
||||||
|
12
|
||||||
gem "rails", "3.2.13"
|
gem "rails", "3.2.13"
|
||||||
|
13
|
||||||
gem "jquery-rails", "~> 2.0.2"
|
gem "jquery-rails", "~> 2.0.2"
|
||||||
|
14
|
||||||
gem "i18n", "~> 0.6.0"
|
gem "i18n", "~> 0.6.0"
|
||||||
|
15
|
||||||
gem "coderay", "~> 1.0.6"
|
gem "coderay", "~> 1.0.6"
|
||||||
|
16
|
||||||
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
|
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
|
||||||
|
17
|
||||||
gem "builder", "3.0.0"
|
gem "builder", "3.0.0"
|
||||||
|
18
|
||||||
gem 'acts-as-taggable-on', '2.4.1'
|
gem 'acts-as-taggable-on', '2.4.1'
|
||||||
|
19
|
||||||
|
gem 'spreadsheet'
|
||||||
|
20
|
||||||
|
gem 'ruby-ole'
|
||||||
|
21
|
||||||
|
22
|
||||||
group :development do
|
group :development do
|
||||||
|
23
|
||||||
gem 'better_errors', path: 'lib/better_errors'
|
gem 'better_errors', path: 'lib/better_errors'
|
||||||
|
24
|
||||||
gem 'rack-mini-profiler', path: 'lib/rack-mini-profiler'
|
gem 'rack-mini-profiler', path: 'lib/rack-mini-profiler'
|
||||||
if ENV['PRY']
|
25
|
||||||
gem 'pry'
|
end
|
||||||
gem 'pry-nav'
|
26
|
||||||
|
27
|
||||||
|
group :test do
|
||||||
|
28
|
||||||
|
gem "shoulda", "~> 3.5.0"
|
||||||
|
29
|
||||||
|
gem "mocha", "~> 1.1.0"
|
||||||
|
30
|
||||||
|
gem 'capybara', '~> 2.4.1'
|
||||||
|
31
|
||||||
|
gem 'nokogiri', '~> 1.6.3'
|
||||||
|
32
|
||||||
|
gem 'factory_girl', '~> 4.4.0'
|
||||||
|
33
|
||||||
|
gem 'selenium-webdriver', '~> 2.42.0'
|
||||||
|
34
|
||||||
|
35
|
||||||
|
36
|
||||||
|
platforms :mri, :mingw do
|
||||||
|
37
|
||||||
|
group :rmagick do
|
||||||
|
38
|
||||||
|
# RMagick 2 supports ruby 1.9
|
||||||
|
39
|
||||||
|
# RMagick 1 would be fine for ruby 1.8 but Bundler does not support
|
||||||
|
40
|
||||||
|
# different requirements for the same gem on different platforms
|
||||||
|
41
|
||||||
|
gem "rmagick", ">= 2.0.0"
|
||||||
|
42
|
||||||
|
end
|
||||||
|
43
|
||||||
end
|
end
|
||||||
|
44
|
||||||
end
|
end
|
||||||
|
45
|
||||||
# group :test do
|
46
|
||||||
# # shoulda的版本做了改动
|
group :development, :test do
|
||||||
# #gem "shoulda", "~> 3.3.2"
|
47
|
||||||
# gem "shoulda", "> 3.3.2"
|
gem "guard-rails", '~> 0.5.3'
|
||||||
# gem "mocha", "~> 0.13.3"
|
48
|
||||||
# gem 'capybara', '~> 2.0.0'
|
gem 'spork-testunit', '~> 0.0.8'
|
||||||
# gem 'nokogiri', '< 1.6.0'
|
49
|
||||||
# end
|
gem 'guard-spork', '~> 1.5.1'
|
||||||
|
50
|
||||||
|
gem 'guard-test', '~> 1.0.0'
|
||||||
|
51
|
||||||
|
gem 'ruby-prof', '~> 0.15.1' unless RUBY_PLATFORM =~ /w32/
|
||||||
|
52
|
||||||
|
gem 'pry'
|
||||||
|
53
|
||||||
|
gem 'pry-nav'
|
||||||
|
54
|
||||||
|
55
|
||||||
|
end
|
||||||
|
56
|
||||||
|
57
|
||||||
|
58
|
||||||
# Gems used only for assets and not required
|
# Gems used only for assets and not required
|
||||||
|
59
|
||||||
# in production environments by default.
|
# in production environments by default.
|
||||||
|
60
|
||||||
group :assets do
|
group :assets do
|
||||||
|
61
|
||||||
gem 'sass-rails', '~> 3.2.3'
|
gem 'sass-rails', '~> 3.2.3'
|
||||||
|
62
|
||||||
gem 'coffee-rails', '~> 3.2.1'
|
gem 'coffee-rails', '~> 3.2.1'
|
||||||
|
63
|
||||||
|
64
|
||||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||||
|
65
|
||||||
gem 'therubyracer', :platforms => :ruby
|
gem 'therubyracer', :platforms => :ruby
|
||||||
|
66
|
||||||
|
67
|
||||||
gem 'uglifier', '>= 1.0.3'
|
gem 'uglifier', '>= 1.0.3'
|
||||||
|
68
|
||||||
end
|
end
|
||||||
|
69
|
||||||
|
70
|
||||||
# Optional gem for LDAP authentication
|
# Optional gem for LDAP authentication
|
||||||
|
71
|
||||||
group :ldap do
|
group :ldap do
|
||||||
|
72
|
||||||
gem "net-ldap", "~> 0.3.1"
|
gem "net-ldap", "~> 0.3.1"
|
||||||
|
73
|
||||||
end
|
end
|
||||||
|
74
|
||||||
|
75
|
||||||
# platforms :mri, :mingw do
|
76
|
||||||
# group :rmagick do
|
|
||||||
# # RMagick 2 supports ruby 1.9
|
|
||||||
# # RMagick 1 would be fine for ruby 1.8 but Bundler does not support
|
|
||||||
# # different requirements for the same gem on different platforms
|
|
||||||
# gem "rmagick", ">= 2.0.0"
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
# Optional gem for OpenID authentication
|
# Optional gem for OpenID authentication
|
||||||
|
77
|
||||||
group :openid do
|
group :openid do
|
||||||
|
78
|
||||||
gem "ruby-openid", "~> 2.1.4", :require => "openid"
|
gem "ruby-openid", "~> 2.1.4", :require => "openid"
|
||||||
|
79
|
||||||
gem "rack-openid"
|
gem "rack-openid"
|
||||||
|
80
|
||||||
end
|
end
|
||||||
|
81
|
||||||
|
82
|
||||||
# Optional gem for exporting the gantt to a PNG file, not supported with jruby
|
# Optional gem for exporting the gantt to a PNG file, not supported with jruby
|
||||||
|
83
|
||||||
platforms :jruby do
|
platforms :jruby do
|
||||||
|
84
|
||||||
# jruby-openssl is bundled with JRuby 1.7.0
|
# jruby-openssl is bundled with JRuby 1.7.0
|
||||||
|
85
|
||||||
gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'
|
gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'
|
||||||
|
86
|
||||||
gem "activerecord-jdbc-adapter", "1.2.5"
|
gem "activerecord-jdbc-adapter", "1.2.5"
|
||||||
|
87
|
||||||
end
|
end
|
||||||
|
88
|
||||||
|
89
|
||||||
# Include database gems for the adapters found in the database
|
# Include database gems for the adapters found in the database
|
||||||
|
90
|
||||||
# configuration file
|
# configuration file
|
||||||
|
91
|
||||||
require 'erb'
|
require 'erb'
|
||||||
|
92
|
||||||
require 'yaml'
|
require 'yaml'
|
||||||
|
93
|
||||||
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
|
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
|
||||||
|
94
|
||||||
if File.exist?(database_file)
|
if File.exist?(database_file)
|
||||||
|
95
|
||||||
database_config = YAML::load(ERB.new(IO.read(database_file)).result)
|
database_config = YAML::load(ERB.new(IO.read(database_file)).result)
|
||||||
|
96
|
||||||
adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
|
adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
|
||||||
|
97
|
||||||
if adapters.any?
|
if adapters.any?
|
||||||
|
98
|
||||||
adapters.each do |adapter|
|
adapters.each do |adapter|
|
||||||
|
99
|
||||||
case adapter
|
case adapter
|
||||||
|
100
|
||||||
when 'mysql2'
|
when 'mysql2'
|
||||||
|
101
|
||||||
gem "mysql2", "= 0.3.11", :platforms => [:mri, :mingw]
|
gem "mysql2", "= 0.3.11", :platforms => [:mri, :mingw]
|
||||||
|
102
|
||||||
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
|
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
|
||||||
|
103
|
||||||
when 'mysql'
|
when 'mysql'
|
||||||
|
104
|
||||||
gem "mysql", "~> 2.8.1", :platforms => [:mri, :mingw]
|
gem "mysql", "~> 2.8.1", :platforms => [:mri, :mingw]
|
||||||
|
105
|
||||||
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
|
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
|
||||||
|
106
|
||||||
when /postgresql/
|
when /postgresql/
|
||||||
|
107
|
||||||
gem "pg", ">= 0.11.0", :platforms => [:mri, :mingw]
|
gem "pg", ">= 0.11.0", :platforms => [:mri, :mingw]
|
||||||
|
108
|
||||||
gem "activerecord-jdbcpostgresql-adapter", :platforms => :jruby
|
gem "activerecord-jdbcpostgresql-adapter", :platforms => :jruby
|
||||||
|
109
|
||||||
when /sqlite3/
|
when /sqlite3/
|
||||||
|
110
|
||||||
gem "sqlite3", :platforms => [:mri, :mingw]
|
gem "sqlite3", :platforms => [:mri, :mingw]
|
||||||
|
111
|
||||||
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
||||||
|
112
|
||||||
when /sqlserver/
|
when /sqlserver/
|
||||||
|
113
|
||||||
gem "tiny_tds", "~> 0.5.1", :platforms => [:mri, :mingw]
|
gem "tiny_tds", "~> 0.5.1", :platforms => [:mri, :mingw]
|
||||||
|
114
|
||||||
gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw]
|
gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw]
|
||||||
|
115
|
||||||
else
|
else
|
||||||
|
116
|
||||||
warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
|
warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
|
||||||
|
117
|
||||||
end
|
end
|
||||||
|
118
|
||||||
end
|
end
|
||||||
|
119
|
||||||
else
|
else
|
||||||
|
120
|
||||||
warn("No adapter found in config/database.yml, please configure it first")
|
warn("No adapter found in config/database.yml, please configure it first")
|
||||||
|
121
|
||||||
end
|
end
|
||||||
|
122
|
||||||
else
|
else
|
||||||
|
123
|
||||||
warn("Please configure your config/database.yml first")
|
warn("Please configure your config/database.yml first")
|
||||||
|
124
|
||||||
end
|
end
|
||||||
|
125
|
||||||
|
126
|
||||||
local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
|
local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
|
||||||
|
127
|
||||||
if File.exists?(local_gemfile)
|
if File.exists?(local_gemfile)
|
||||||
|
128
|
||||||
puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v`
|
puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v`
|
||||||
|
129
|
||||||
instance_eval File.read(local_gemfile)
|
instance_eval File.read(local_gemfile)
|
||||||
|
130
|
||||||
end
|
end
|
||||||
|
131
|
||||||
|
132
|
||||||
# Load plugins' Gemfiles
|
# Load plugins' Gemfiles
|
||||||
|
133
|
||||||
Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|
|
Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|
|
||||||
|
134
|
||||||
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
|
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
|
||||||
|
135
|
||||||
instance_eval File.read(file)
|
instance_eval File.read(file)
|
||||||
end
|
136
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
class PollAnswerController < ApplicationController
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
class PollController < ApplicationController
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
class PollQuestionController < ApplicationController
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
class PollUserController < ApplicationController
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
class PollVoteController < ApplicationController
|
||||||
|
end
|
@ -0,0 +1,9 @@
|
|||||||
|
class Poll < ActiveRecord::Base
|
||||||
|
#attr_accessible :closed_at, :polls_group_id, :polls_name, :polls_status, :polls_type, :published_at, :user_id
|
||||||
|
include Redmine::SafeAttributes
|
||||||
|
|
||||||
|
belongs_to :user
|
||||||
|
has_many :poll_questions, :dependent => :destroy
|
||||||
|
has_many :poll_users, :dependent => :destroy
|
||||||
|
has_many :users, :through => :poll_users #该文件被哪些用户提交答案过
|
||||||
|
end
|
@ -0,0 +1,7 @@
|
|||||||
|
class PollAnswer < ActiveRecord::Base
|
||||||
|
# attr_accessible :answer_position, :answer_text, :poll_questions_id
|
||||||
|
include Redmine::SafeAttributes
|
||||||
|
|
||||||
|
belongs_to :poll_question
|
||||||
|
has_many :poll_votes, :dependent => :destroy
|
||||||
|
end
|
@ -0,0 +1,8 @@
|
|||||||
|
class PollQuestion < ActiveRecord::Base
|
||||||
|
# attr_accessible :is_necessary, :polls_id, :question_title, :question_type
|
||||||
|
include Redmine::SafeAttributes
|
||||||
|
|
||||||
|
belongs_to :poll
|
||||||
|
has_many :poll_answers, :dependent => :destroy
|
||||||
|
has_many :poll_votes, :dependent => :destroy
|
||||||
|
end
|
@ -0,0 +1,7 @@
|
|||||||
|
class PollUser < ActiveRecord::Base
|
||||||
|
# attr_accessible :poll_id, :user_id
|
||||||
|
include Redmine::SafeAttributes
|
||||||
|
|
||||||
|
belongs_to :poll
|
||||||
|
belongs_to :user
|
||||||
|
end
|
@ -0,0 +1,8 @@
|
|||||||
|
class PollVote < ActiveRecord::Base
|
||||||
|
# attr_accessible :poll_answers_id, :poll_questions_id, :user_id, :vote_text
|
||||||
|
include Redmine::SafeAttributes
|
||||||
|
|
||||||
|
belongs_to :poll_answer
|
||||||
|
belongs_to :poll_question
|
||||||
|
belongs_to :user
|
||||||
|
end
|
@ -0,0 +1,6 @@
|
|||||||
|
$(function(){
|
||||||
|
$("#button1").click(function(){
|
||||||
|
myTips("您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!","success");
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
@ -1,6 +1,6 @@
|
|||||||
<div class="clearfix"></div>
|
|
||||||
<div class="linkother">
|
<div class="linkother" style="margin-left: 30%; float: left">
|
||||||
<a href="http://<%= Setting.host_name%>" class="link_other_item"><%=l(:label_projects_management_platform)%></a>
|
<a href="http://<%= Setting.host_name%>" class="link_other_item"><%=l(:label_projects_management_platform)%></a>
|
||||||
<a href="http://<%= Setting.host_course%>" class="link_other_item"><%=l(:label_courses_management_platform)%></a>
|
<a href="http://<%= Setting.host_course%>" class="link_other_item"><%=l(:label_courses_management_platform)%></a>
|
||||||
<a href="http://<%= Setting.host_contest%>" class="link_other_item"><%=l(:label_contests_management_platform)%></a>
|
<a href="http://<%= Setting.host_contest%>" class="link_other_item"><%=l(:label_contests_management_platform)%></a>
|
||||||
</div>
|
</div>
|
@ -1,58 +1,58 @@
|
|||||||
<%
|
<%
|
||||||
select_option = []
|
select_option = []
|
||||||
(select_option << ['项目', 'projects']) if project_type == Project::ProjectType_project
|
(select_option << ['项目', 'projects']) if project_type == Project::ProjectType_project
|
||||||
(select_option << ['课程', 'courses']) if project_type == Project::ProjectType_course
|
(select_option << ['课程', 'courses']) if project_type == Project::ProjectType_course
|
||||||
select_option << ['用户', 'users']
|
select_option << ['用户', 'users']
|
||||||
#select_option << ['教师', 'users_teacher'],
|
#select_option << ['教师', 'users_teacher'],
|
||||||
#select_option << ['学生', 'users_student']
|
#select_option << ['学生', 'users_student']
|
||||||
%>
|
%>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
form #q, form #search_type{
|
form #q, form #search_type{
|
||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
-moz-box-sizing: border-box;
|
-moz-box-sizing: border-box;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
height: 33px;
|
height: 33px;
|
||||||
}
|
}
|
||||||
form #q{
|
form #q{
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
border-top-left-radius: 5px;
|
border-top-left-radius: 5px;
|
||||||
border-bottom-left-radius: 5px;
|
border-bottom-left-radius: 5px;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
|
|
||||||
}
|
}
|
||||||
form #search_type{
|
form #search_type{
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: #363739;
|
color: #363739;
|
||||||
border-top-right-radius: 5px;
|
border-top-right-radius: 5px;
|
||||||
border-bottom-right-radius: 5px;
|
border-bottom-right-radius: 5px;
|
||||||
border-bottom-left-radius: 0px;
|
border-bottom-left-radius: 0px;
|
||||||
border-top-left-radius: 0px;
|
border-top-left-radius: 0px;
|
||||||
border-left: 1px outset #83A9A9;
|
border-left: 1px outset #83A9A9;
|
||||||
margin-left: -4px;
|
margin-left: -4px;
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
text-indent: 0.01px;
|
text-indent: 0.01px;
|
||||||
text-overflow: '';
|
text-overflow: '';
|
||||||
}
|
}
|
||||||
.search_widget{
|
.search_widget{
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
.search_widget:hover{
|
.search_widget:hover{
|
||||||
box-shadow: 0px 0px 3px #56B4EF;
|
box-shadow: 0px 0px 3px #56B4EF;
|
||||||
}
|
}
|
||||||
<%#完了把上面东西放到 .css 里%>
|
<%#完了把上面东西放到 .css 里%>
|
||||||
</style>
|
</style>
|
||||||
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
|
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
|
||||||
<div class="project-search" style="float: right">
|
<div class="project-search" style="float: right">
|
||||||
<div class='search_widget'>
|
<div class='search_widget'>
|
||||||
<%= text_field_tag :q, nil, placeholder:'请输入要搜索的关键字', :size => 27 %>
|
<%= text_field_tag :q, nil, placeholder:'请输入要搜索的关键字', :size => 27, %>
|
||||||
<%= select_tag(:search_type, options_for_select(select_option) ) %>
|
<%= select_tag(:search_type, options_for_select(select_option), :style => "float:right" ) %>
|
||||||
</div>
|
</div>
|
||||||
<%#= hidden_field_tag 'project_type', project_type %>
|
<%#= hidden_field_tag 'project_type', project_type %>
|
||||||
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil, :style => "float:right" %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -0,0 +1,52 @@
|
|||||||
|
# Default setup is given for MySQL with ruby1.9. If you're running Redmine
|
||||||
|
# with MySQL and ruby1.8, replace the adapter name with `mysql`.
|
||||||
|
# Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end.
|
||||||
|
# Line indentation must be 2 spaces (no tabs).
|
||||||
|
|
||||||
|
production:
|
||||||
|
adapter: mysql2
|
||||||
|
database: redmine
|
||||||
|
host: localhost
|
||||||
|
username: root
|
||||||
|
password: ""
|
||||||
|
encoding: utf8
|
||||||
|
|
||||||
|
development:
|
||||||
|
adapter: mysql2
|
||||||
|
database: redmine_development
|
||||||
|
host: 10.107.17.20
|
||||||
|
username: root
|
||||||
|
password: "1234"
|
||||||
|
encoding: utf8
|
||||||
|
|
||||||
|
# Warning: The database defined as "test" will be erased and
|
||||||
|
# re-generated from your development database when you run "rake".
|
||||||
|
# Do not set this db to the same as development or production.
|
||||||
|
test:
|
||||||
|
adapter: mysql2
|
||||||
|
database: redmine_test
|
||||||
|
host: 10.107.17.20
|
||||||
|
username: root
|
||||||
|
password: "1234"
|
||||||
|
encoding: utf8
|
||||||
|
|
||||||
|
# PostgreSQL configuration example
|
||||||
|
#production:
|
||||||
|
# adapter: postgresql
|
||||||
|
# database: redmine
|
||||||
|
# host: localhost
|
||||||
|
# username: postgres
|
||||||
|
# password: "postgres"
|
||||||
|
|
||||||
|
# SQLite3 configuration example
|
||||||
|
#production:
|
||||||
|
# adapter: sqlite3
|
||||||
|
# database: db/redmine.sqlite3
|
||||||
|
|
||||||
|
# SQL Server configuration example
|
||||||
|
#production:
|
||||||
|
# adapter: sqlserver
|
||||||
|
# database: redmine
|
||||||
|
# host: localhost
|
||||||
|
# username: jenkins
|
||||||
|
# password: jenkins
|
@ -0,0 +1,19 @@
|
|||||||
|
class CreatePolls < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
create_table :polls do |t|
|
||||||
|
t.string :polls_name
|
||||||
|
t.string :polls_type
|
||||||
|
t.integer :polls_group_id
|
||||||
|
t.integer :polls_status
|
||||||
|
t.integer :user_id
|
||||||
|
t.datetime :published_at
|
||||||
|
t.datetime :closed_at
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
drop_table :polls
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,16 @@
|
|||||||
|
class CreatePollQuestions < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
create_table :poll_questions do |t|
|
||||||
|
t.string :question_title
|
||||||
|
t.integer :question_type
|
||||||
|
t.integer :is_necessary
|
||||||
|
t.integer :poll_id
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
drop_table :poll_questions
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,15 @@
|
|||||||
|
class CreatePollAnswers < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
create_table :poll_answers do |t|
|
||||||
|
t.integer :poll_question_id
|
||||||
|
t.text :answer_text
|
||||||
|
t.integer :answer_position
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
drop_table :poll_answers
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,16 @@
|
|||||||
|
class CreatePollVotes < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
create_table :poll_votes do |t|
|
||||||
|
t.integer :user_id
|
||||||
|
t.integer :poll_question_id
|
||||||
|
t.integer :poll_answer_id
|
||||||
|
t.text :vote_text
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
drop_table :poll_votes
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,14 @@
|
|||||||
|
class CreatePollUsers < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
create_table :poll_users do |t|
|
||||||
|
t.integer :user_id
|
||||||
|
t.integer :poll_id
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
drop_table :poll_users
|
||||||
|
end
|
||||||
|
end
|
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,7 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class PollAnswersTest < ActiveSupport::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
@ -0,0 +1,7 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class PollQuestionsTest < ActiveSupport::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
@ -0,0 +1,7 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class PollUserTest < ActiveSupport::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
@ -0,0 +1,7 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class PollVotesTest < ActiveSupport::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
@ -0,0 +1,7 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class PollsTest < ActiveSupport::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
Loading…
Reference in new issue