将autologin默认过期时间改为两个月
This commit is contained in:
parent
5c4ad1ce7d
commit
461d9cc183
|
@ -32,6 +32,8 @@ class Token < ActiveRecord::Base
|
||||||
token = Token.get_token_from_user(user, 'autologin')
|
token = Token.get_token_from_user(user, 'autologin')
|
||||||
unless token
|
unless token
|
||||||
token = Token.create(:user => user, :action => 'autologin')
|
token = Token.create(:user => user, :action => 'autologin')
|
||||||
|
else
|
||||||
|
token..update_attribute(:created_on, Time.now)
|
||||||
end
|
end
|
||||||
token
|
token
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
class ChangeAutologinFromSettings < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
Setting.where(name: 'autologin').update_all(value: 60)
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
Setting.where(name: 'autologin').update_all(value: 7)
|
||||||
|
end
|
||||||
|
end
|
18
db/schema.rb
18
db/schema.rb
|
@ -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 => 20150505025537) do
|
ActiveRecord::Schema.define(:version => 20150510100343) 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
|
||||||
|
@ -438,6 +438,13 @@ ActiveRecord::Schema.define(:version => 20150505025537) do
|
||||||
|
|
||||||
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
||||||
|
|
||||||
|
create_table "discuss_demos", :force => true do |t|
|
||||||
|
t.string "title"
|
||||||
|
t.text "body"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "documents", :force => true do |t|
|
create_table "documents", :force => true do |t|
|
||||||
t.integer "project_id", :default => 0, :null => false
|
t.integer "project_id", :default => 0, :null => false
|
||||||
t.integer "category_id", :default => 0, :null => false
|
t.integer "category_id", :default => 0, :null => false
|
||||||
|
@ -534,6 +541,7 @@ ActiveRecord::Schema.define(:version => 20150505025537) do
|
||||||
t.integer "is_teacher_score", :default => 0
|
t.integer "is_teacher_score", :default => 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "homework_attaches", ["bid_id"], :name => "bid_id"
|
||||||
add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id"
|
add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id"
|
||||||
|
|
||||||
create_table "homework_evaluations", :force => true do |t|
|
create_table "homework_evaluations", :force => true do |t|
|
||||||
|
@ -548,7 +556,9 @@ ActiveRecord::Schema.define(:version => 20150505025537) do
|
||||||
t.integer "bid_id"
|
t.integer "bid_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "homework_for_courses", ["bid_id"], :name => "bid_id"
|
||||||
add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id"
|
add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id"
|
||||||
|
add_index "homework_for_courses", ["course_id"], :name => "course_id"
|
||||||
add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id"
|
add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id"
|
||||||
|
|
||||||
create_table "homework_users", :force => true do |t|
|
create_table "homework_users", :force => true do |t|
|
||||||
|
@ -1153,12 +1163,14 @@ ActiveRecord::Schema.define(:version => 20150505025537) do
|
||||||
create_table "students_for_courses", :force => true do |t|
|
create_table "students_for_courses", :force => true do |t|
|
||||||
t.integer "student_id"
|
t.integer "student_id"
|
||||||
t.integer "course_id"
|
t.integer "course_id"
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
|
t.integer "student_idCopy"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id"
|
add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id"
|
||||||
add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id"
|
add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id"
|
||||||
|
add_index "students_for_courses", ["student_id"], :name => "student_id"
|
||||||
|
|
||||||
create_table "taggings", :force => true do |t|
|
create_table "taggings", :force => true do |t|
|
||||||
t.integer "tag_id"
|
t.integer "tag_id"
|
||||||
|
|
Loading…
Reference in New Issue