delete some interface
This commit is contained in:
parent
c963a80e8c
commit
ffbe4942b7
|
@ -346,7 +346,8 @@ class ApplicationController < ActionController::Base
|
|||
User.current = User.find 8686
|
||||
elsif params[:debug] == 'admin'
|
||||
logger.info "@@@@@@@@@@@@@@@@@@@@@@ debug mode....."
|
||||
user = User.find 36480
|
||||
# user = User.find 36480
|
||||
user = User.find 5
|
||||
User.current = user
|
||||
cookies.signed[:user_id] = user.id
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Ci::DbConnectable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
include do
|
||||
included do
|
||||
end
|
||||
|
||||
# Dynamically sets the database connection.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
class SponsorTiersController < ApplicationController
|
||||
before_action :set_sponsor_tier, only: [:show, :edit, :update, :destroy]
|
||||
before_action :check_sponsor, only: [:show]
|
||||
before_action :require_login, only: [:create, :update, :destroy]
|
||||
|
||||
# GET /sponsor_tiers
|
||||
# GET /sponsor_tiers.json
|
||||
|
@ -16,16 +17,6 @@ class SponsorTiersController < ApplicationController
|
|||
|
||||
end
|
||||
|
||||
# GET /sponsor_tiers/new
|
||||
def new
|
||||
# @sponsor_tier = SponsorTier.new
|
||||
# User.current.create
|
||||
end
|
||||
|
||||
# GET /sponsor_tiers/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /sponsor_tiers
|
||||
# POST /sponsor_tiers.json
|
||||
def create
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class SponsorshipsController < ApplicationController
|
||||
before_action :set_sponsorship, only: [:show, :edit, :update, :destroy]
|
||||
# before_action :require_login, except: [:index, :stopped, :sponsored, :sponsoring, :stopped_sponsored, :stopped_sponsoring]
|
||||
before_action :require_login, only: [:show, :new, :create, :edit, :update, :destroy]
|
||||
before_action :require_login, only: [:new, :create, :edit, :update, :destroy]
|
||||
skip_after_action :user_trace_log, only: [:update]
|
||||
|
||||
# GET /sponsorships
|
||||
|
@ -71,15 +71,6 @@ class SponsorshipsController < ApplicationController
|
|||
def show
|
||||
end
|
||||
|
||||
# GET /sponsorships/new
|
||||
def new
|
||||
@sponsorship = Sponsorship.new
|
||||
end
|
||||
|
||||
# GET /sponsorships/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /sponsorships
|
||||
# POST /sponsorships.json
|
||||
def create
|
||||
|
|
|
@ -2,33 +2,39 @@
|
|||
#
|
||||
# Table name: attachments
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# container_id :integer
|
||||
# container_type :string(30)
|
||||
# filename :string(255) default(""), not null
|
||||
# disk_filename :string(255) default(""), not null
|
||||
# filesize :integer default("0"), not null
|
||||
# content_type :string(255) default("")
|
||||
# digest :string(40) default(""), not null
|
||||
# downloads :integer default("0"), not null
|
||||
# author_id :integer default("0"), not null
|
||||
# created_on :datetime
|
||||
# description :text(65535)
|
||||
# disk_directory :string(255)
|
||||
# attachtype :integer default("1")
|
||||
# is_public :integer default("1")
|
||||
# copy_from :integer
|
||||
# quotes :integer
|
||||
# is_publish :integer default("1")
|
||||
# publish_time :datetime
|
||||
# memo_image :boolean default("0")
|
||||
# extra_type :integer default("0")
|
||||
# id :integer not null, primary key
|
||||
# container_id :integer
|
||||
# container_type :string(30)
|
||||
# filename :string(255) default(""), not null
|
||||
# disk_filename :string(255) default(""), not null
|
||||
# filesize :integer default("0"), not null
|
||||
# content_type :string(255) default("")
|
||||
# digest :string(60) default(""), not null
|
||||
# downloads :integer default("0"), not null
|
||||
# author_id :integer default("0"), not null
|
||||
# created_on :datetime
|
||||
# description :text(65535)
|
||||
# disk_directory :string(255)
|
||||
# attachtype :integer default("1")
|
||||
# is_public :integer default("1")
|
||||
# copy_from :integer
|
||||
# quotes :integer default("0")
|
||||
# is_publish :integer default("1")
|
||||
# publish_time :datetime
|
||||
# resource_bank_id :integer
|
||||
# unified_setting :boolean default("1")
|
||||
# cloud_url :string(255) default("")
|
||||
# course_second_category_id :integer default("0")
|
||||
# delay_publish :boolean default("0")
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_attachments_on_author_id (author_id)
|
||||
# index_attachments_on_container_id_and_container_type (container_id,container_type)
|
||||
# index_attachments_on_course_second_category_id (course_second_category_id)
|
||||
# index_attachments_on_created_on (created_on)
|
||||
# index_attachments_on_is_public (is_public)
|
||||
# index_attachments_on_quotes (quotes)
|
||||
#
|
||||
|
||||
class Attachment < ApplicationRecord
|
||||
|
|
|
@ -2,54 +2,54 @@
|
|||
#
|
||||
# Table name: users
|
||||
#
|
||||
# id :integer not null
|
||||
# login :string(255) default(""), not null
|
||||
# hashed_password :string(40) default(""), not null
|
||||
# firstname :string(30) default(""), not null
|
||||
# lastname :string(255) default(""), not null
|
||||
# mail :string(60)
|
||||
# admin :boolean default("0"), not null
|
||||
# status :integer default("1"), not null
|
||||
# last_login_on :datetime
|
||||
# language :string(5) default("")
|
||||
# auth_source_id :integer
|
||||
# created_on :datetime
|
||||
# updated_on :datetime
|
||||
# type :string(255)
|
||||
# identity_url :string(255)
|
||||
# mail_notification :string(255) default(""), not null
|
||||
# salt :string(64)
|
||||
# gid :integer
|
||||
# visits :integer default("0")
|
||||
# excellent_teacher :integer default("0")
|
||||
# excellent_student :integer default("0")
|
||||
# phone :string(255)
|
||||
# authentication :boolean default("0")
|
||||
# grade :integer default("0")
|
||||
# experience :integer default("0")
|
||||
# nickname :string(255)
|
||||
# show_realname :boolean default("1")
|
||||
# professional_certification :boolean default("0")
|
||||
# ID_number :string(255)
|
||||
# certification :integer default("0")
|
||||
# homepage_teacher :boolean default("0")
|
||||
# homepage_engineer :boolean default("0")
|
||||
# is_test :integer default("0")
|
||||
# ecoder_user_id :integer default("0")
|
||||
# business :boolean default("0")
|
||||
# profile_completed :boolean default("0")
|
||||
# laboratory_id :integer
|
||||
# platform :string(255) default("0")
|
||||
# gitea_token :string(255)
|
||||
# gitea_uid :integer
|
||||
# is_shixun_marker :boolean default("0")
|
||||
# is_sync_pwd :boolean default("1")
|
||||
# watchers_count :integer default("0")
|
||||
# visibility :string(255) default("public")
|
||||
# repo_admin_change_team_access :boolean default("1")
|
||||
# is_org :boolean default("0")
|
||||
# website :string(255)
|
||||
# devops_step :integer default("0")
|
||||
# id :integer not null
|
||||
# login :string(255) default(""), not null
|
||||
# hashed_password :string(40) default(""), not null
|
||||
# firstname :string(30) default(""), not null
|
||||
# lastname :string(255) default(""), not null
|
||||
# mail :string(60)
|
||||
# admin :boolean default("0"), not null
|
||||
# status :integer default("1"), not null
|
||||
# last_login_on :datetime
|
||||
# language :string(5) default("")
|
||||
# auth_source_id :integer
|
||||
# created_on :datetime
|
||||
# updated_on :datetime
|
||||
# type :string(255)
|
||||
# identity_url :string(255)
|
||||
# mail_notification :string(255) default(""), not null
|
||||
# salt :string(64)
|
||||
# gid :integer
|
||||
# visits :integer default("0")
|
||||
# excellent_teacher :integer default("0")
|
||||
# excellent_student :integer default("0")
|
||||
# phone :string(255)
|
||||
# authentication :boolean default("0")
|
||||
# grade :integer default("0")
|
||||
# experience :integer default("0")
|
||||
# nickname :string(255)
|
||||
# show_realname :boolean default("1")
|
||||
# professional_certification :boolean default("0")
|
||||
# ID_number :string(255)
|
||||
# certification :integer default("0")
|
||||
# homepage_teacher :boolean default("0")
|
||||
# homepage_engineer :boolean default("0")
|
||||
# is_test :integer default("0")
|
||||
# ecoder_user_id :integer default("0")
|
||||
# business :boolean default("0")
|
||||
# profile_completed :boolean default("0")
|
||||
# laboratory_id :integer
|
||||
# platform :string(255) default("0")
|
||||
# gitea_token :string(255)
|
||||
# gitea_uid :integer
|
||||
# is_shixun_marker :boolean default("0")
|
||||
# is_sync_pwd :boolean default("1")
|
||||
# watchers_count :integer default("0")
|
||||
# sponsor_certification :integer default("0")
|
||||
# sponsor_num :integer default("0")
|
||||
# sponsored_num :integer default("0")
|
||||
# description :text(65535)
|
||||
# devops_step :integer default("0")
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
|
|
@ -1,3 +1,17 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: coin_changes
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# amount :integer
|
||||
# description :string(255)
|
||||
# reason :string(255)
|
||||
# to_wallet_id :integer
|
||||
# from_wallet_id :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
|
||||
class CoinChange < ApplicationRecord
|
||||
belongs_to :to_wallet, class_name: 'Wallet'
|
||||
belongs_to :from_wallet, class_name: 'Wallet'
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: passed_waitlists
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# applicant_id :string(255)
|
||||
# integer :string(255)
|
||||
# reviewer_id :string(255)
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
|
||||
class PassedWaitlist < ApplicationRecord
|
||||
belongs_to :applicant, class_name: 'User'
|
||||
belongs_to :reviewer, class_name: 'User'
|
||||
|
|
|
@ -6,10 +6,14 @@
|
|||
# user_id :integer not null
|
||||
# praise_tread_object_id :integer
|
||||
# praise_tread_object_type :string(255)
|
||||
# praise_or_tread :integer
|
||||
# praise_or_tread :integer default("1")
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# praise_tread (praise_tread_object_id,praise_tread_object_type)
|
||||
#
|
||||
|
||||
class PraiseTread < ApplicationRecord
|
||||
belongs_to :user
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
# id :integer not null, primary key
|
||||
# name :string(255) default(""), not null
|
||||
# description :text(4294967295)
|
||||
# description :text(65535)
|
||||
# homepage :string(255) default("")
|
||||
# is_public :boolean default("1"), not null
|
||||
# parent_id :integer
|
||||
|
@ -48,10 +48,6 @@
|
|||
# issue_tags_count :integer default("0")
|
||||
# closed_issues_count :integer default("0")
|
||||
# open_devops :boolean default("0")
|
||||
# gitea_webhook_id :integer
|
||||
# open_devops_count :integer default("0")
|
||||
# recommend :boolean default("0")
|
||||
# platform :integer default("0")
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
# issue_id :integer
|
||||
# fork_project_id :integer
|
||||
# is_original :boolean default("0")
|
||||
# comments_count :integer default("0")
|
||||
# commits_count :integer default("0")
|
||||
# files_count :integer default("0")
|
||||
#
|
||||
|
||||
class PullRequest < ApplicationRecord
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: sponsor_tiers
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# tier :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# description :string(255) default("")
|
||||
# user_id :integer
|
||||
#
|
||||
|
||||
class SponsorTier < ApplicationRecord
|
||||
belongs_to :user
|
||||
|
||||
|
|
|
@ -1,3 +1,17 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: sponsorships
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# amount :integer
|
||||
# visible :integer
|
||||
# sponsor_id :integer
|
||||
# developer_id :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# accumulate :integer default("0")
|
||||
#
|
||||
|
||||
class Sponsorship < ApplicationRecord
|
||||
belongs_to :sponsor, class_name: 'User'
|
||||
belongs_to :developer, class_name: 'User'
|
||||
|
|
|
@ -1,3 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: stopped_sponsorships
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# amount :integer
|
||||
# sponsor_id :integer
|
||||
# developer_id :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# start_time :datetime
|
||||
# visible :integer
|
||||
# accumulate :integer default("0")
|
||||
#
|
||||
|
||||
class StoppedSponsorship < ApplicationRecord
|
||||
belongs_to :sponsor, class_name: 'User'
|
||||
belongs_to :developer, class_name: 'User'
|
||||
|
|
|
@ -2,54 +2,54 @@
|
|||
#
|
||||
# Table name: users
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# login :string(255) default(""), not null
|
||||
# hashed_password :string(40) default(""), not null
|
||||
# firstname :string(30) default(""), not null
|
||||
# lastname :string(255) default(""), not null
|
||||
# mail :string(60)
|
||||
# admin :boolean default("0"), not null
|
||||
# status :integer default("1"), not null
|
||||
# last_login_on :datetime
|
||||
# language :string(5) default("")
|
||||
# auth_source_id :integer
|
||||
# created_on :datetime
|
||||
# updated_on :datetime
|
||||
# type :string(255)
|
||||
# identity_url :string(255)
|
||||
# mail_notification :string(255) default(""), not null
|
||||
# salt :string(64)
|
||||
# gid :integer
|
||||
# visits :integer default("0")
|
||||
# excellent_teacher :integer default("0")
|
||||
# excellent_student :integer default("0")
|
||||
# phone :string(255)
|
||||
# authentication :boolean default("0")
|
||||
# grade :integer default("0")
|
||||
# experience :integer default("0")
|
||||
# nickname :string(255)
|
||||
# show_realname :boolean default("1")
|
||||
# professional_certification :boolean default("0")
|
||||
# ID_number :string(255)
|
||||
# certification :integer default("0")
|
||||
# homepage_teacher :boolean default("0")
|
||||
# homepage_engineer :boolean default("0")
|
||||
# is_test :integer default("0")
|
||||
# ecoder_user_id :integer default("0")
|
||||
# business :boolean default("0")
|
||||
# profile_completed :boolean default("0")
|
||||
# laboratory_id :integer
|
||||
# platform :string(255) default("0")
|
||||
# gitea_token :string(255)
|
||||
# gitea_uid :integer
|
||||
# is_shixun_marker :boolean default("0")
|
||||
# is_sync_pwd :boolean default("1")
|
||||
# watchers_count :integer default("0")
|
||||
# visibility :string(255) default("public")
|
||||
# repo_admin_change_team_access :boolean default("1")
|
||||
# is_org :boolean default("0")
|
||||
# website :string(255)
|
||||
# devops_step :integer default("0")
|
||||
# id :integer not null, primary key
|
||||
# login :string(255) default(""), not null
|
||||
# hashed_password :string(40) default(""), not null
|
||||
# firstname :string(30) default(""), not null
|
||||
# lastname :string(255) default(""), not null
|
||||
# mail :string(60)
|
||||
# admin :boolean default("0"), not null
|
||||
# status :integer default("1"), not null
|
||||
# last_login_on :datetime
|
||||
# language :string(5) default("")
|
||||
# auth_source_id :integer
|
||||
# created_on :datetime
|
||||
# updated_on :datetime
|
||||
# type :string(255)
|
||||
# identity_url :string(255)
|
||||
# mail_notification :string(255) default(""), not null
|
||||
# salt :string(64)
|
||||
# gid :integer
|
||||
# visits :integer default("0")
|
||||
# excellent_teacher :integer default("0")
|
||||
# excellent_student :integer default("0")
|
||||
# phone :string(255)
|
||||
# authentication :boolean default("0")
|
||||
# grade :integer default("0")
|
||||
# experience :integer default("0")
|
||||
# nickname :string(255)
|
||||
# show_realname :boolean default("1")
|
||||
# professional_certification :boolean default("0")
|
||||
# ID_number :string(255)
|
||||
# certification :integer default("0")
|
||||
# homepage_teacher :boolean default("0")
|
||||
# homepage_engineer :boolean default("0")
|
||||
# is_test :integer default("0")
|
||||
# ecoder_user_id :integer default("0")
|
||||
# business :boolean default("0")
|
||||
# profile_completed :boolean default("0")
|
||||
# laboratory_id :integer
|
||||
# platform :string(255) default("0")
|
||||
# gitea_token :string(255)
|
||||
# gitea_uid :integer
|
||||
# is_shixun_marker :boolean default("0")
|
||||
# is_sync_pwd :boolean default("1")
|
||||
# watchers_count :integer default("0")
|
||||
# sponsor_certification :integer default("0")
|
||||
# sponsor_num :integer default("0")
|
||||
# sponsored_num :integer default("0")
|
||||
# description :text(65535)
|
||||
# devops_step :integer default("0")
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: waitlists
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# applicant_id :string(255)
|
||||
# integer :string(255)
|
||||
# reviewer_id :string(255)
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
|
||||
class Waitlist < ApplicationRecord
|
||||
belongs_to :applicant, class_name: 'User'
|
||||
belongs_to :reviewer, class_name: 'User', optional: true
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: wallets
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# balance :integer
|
||||
# user_id :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
|
||||
class Wallet < ApplicationRecord
|
||||
belongs_to :user
|
||||
has_many :outcome, class_name: 'CoinChange', foreign_key: 'from_wallet_id', dependent: :destroy
|
||||
|
|
|
@ -31,8 +31,8 @@ Rails.application.routes.draw do
|
|||
# post 'log/download', to: 'log#download'
|
||||
match 'log/download/:filename' => 'log#download', :constraints => { filename: /[0-z\.]+/ }, via:[:get]
|
||||
|
||||
resources :sponsor_tiers
|
||||
resources :sponsorships do
|
||||
resources :sponsor_tiers, only: [:index, :show, :create, :update, :destroy]
|
||||
resources :sponsorships, only: [:index, :show, :create, :update, :destroy] do
|
||||
collection do
|
||||
get :sponsored
|
||||
get :sponsoring
|
||||
|
|
|
@ -44,7 +44,7 @@ RSpec.describe SponsorTiersController, type: :controller do
|
|||
describe "GET #index" do
|
||||
it "returns a success response" do
|
||||
SponsorTier.create! valid_attributes
|
||||
get :index, params: {}, session: valid_session
|
||||
get :index, params: {login: qyzh123123}, session: valid_session
|
||||
expect(response).to be_successful
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue