Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gab-social
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
gab
social
gab-social
Commits
520c125e
Commit
520c125e
authored
Jul 16, 2019
by
2458773093
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
group_removed_users table to forbid users joining once removed
parent
c56a8914
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
6 deletions
+51
-6
app/models/group_removed_account.rb
app/models/group_removed_account.rb
+13
-0
db/migrate/20190716173227_create_group_removed_accounts.rb
db/migrate/20190716173227_create_group_removed_accounts.rb
+12
-0
db/schema.rb
db/schema.rb
+19
-6
spec/fabricators/group_removed_account_fabricator.rb
spec/fabricators/group_removed_account_fabricator.rb
+2
-0
spec/models/group_removed_account_spec.rb
spec/models/group_removed_account_spec.rb
+5
-0
No files found.
app/models/group_removed_account.rb
0 → 100644
View file @
520c125e
# == Schema Information
#
# Table name: group_removed_accounts
#
# id :bigint(8) not null, primary key
# group_id :bigint(8) not null
# account_id :bigint(8) not null
# created_at :datetime not null
# updated_at :datetime not null
#
class
GroupRemovedAccount
<
ApplicationRecord
end
db/migrate/20190716173227_create_group_removed_accounts.rb
0 → 100644
View file @
520c125e
class
CreateGroupRemovedAccounts
<
ActiveRecord
::
Migration
[
5.2
]
def
change
create_table
:group_removed_accounts
do
|
t
|
t
.
belongs_to
:group
,
foreign_key:
{
on_delete: :cascade
},
null:
false
t
.
belongs_to
:account
,
foreign_key:
{
on_delete: :cascade
},
null:
false
t
.
timestamps
end
add_index
:group_removed_accounts
,
[
:account_id
,
:group_id
],
unique:
true
add_index
:group_removed_accounts
,
[
:group_id
,
:account_id
]
end
end
db/schema.rb
View file @
520c125e
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#
#
# It's strongly recommended that you check this file into your version control system.
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2019_0
6_07_000211
)
do
ActiveRecord
::
Schema
.
define
(
version:
2019_0
7_16_173227
)
do
# These are extensions that must be enabled in order to support this database
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
enable_extension
"plpgsql"
...
@@ -93,7 +93,7 @@ ActiveRecord::Schema.define(version: 2019_06_07_000211) do
...
@@ -93,7 +93,7 @@ ActiveRecord::Schema.define(version: 2019_06_07_000211) do
t
.
bigint
"account_id"
t
.
bigint
"account_id"
t
.
string
"image_file_name"
t
.
string
"image_file_name"
t
.
string
"image_content_type"
t
.
string
"image_content_type"
t
.
bigint
"image_file_size"
t
.
integer
"image_file_size"
t
.
datetime
"image_updated_at"
t
.
datetime
"image_updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
...
@@ -157,10 +157,10 @@ ActiveRecord::Schema.define(version: 2019_06_07_000211) do
...
@@ -157,10 +157,10 @@ ActiveRecord::Schema.define(version: 2019_06_07_000211) do
t
.
string
"actor_type"
t
.
string
"actor_type"
t
.
boolean
"discoverable"
t
.
boolean
"discoverable"
t
.
string
"also_known_as"
,
array:
true
t
.
string
"also_known_as"
,
array:
true
t
.
datetime
"silenced_at"
t
.
datetime
"suspended_at"
t
.
boolean
"is_pro"
,
default:
false
,
null:
false
t
.
boolean
"is_pro"
,
default:
false
,
null:
false
t
.
datetime
"pro_expires_at"
t
.
datetime
"pro_expires_at"
t
.
datetime
"silenced_at"
t
.
datetime
"suspended_at"
t
.
boolean
"is_verified"
,
default:
false
,
null:
false
t
.
boolean
"is_verified"
,
default:
false
,
null:
false
t
.
boolean
"is_donor"
,
default:
false
,
null:
false
t
.
boolean
"is_donor"
,
default:
false
,
null:
false
t
.
boolean
"is_investor"
,
default:
false
,
null:
false
t
.
boolean
"is_investor"
,
default:
false
,
null:
false
...
@@ -333,6 +333,17 @@ ActiveRecord::Schema.define(version: 2019_06_07_000211) do
...
@@ -333,6 +333,17 @@ ActiveRecord::Schema.define(version: 2019_06_07_000211) do
t
.
index
[
"group_id"
],
name:
"index_group_accounts_on_group_id"
t
.
index
[
"group_id"
],
name:
"index_group_accounts_on_group_id"
end
end
create_table
"group_removed_accounts"
,
force: :cascade
do
|
t
|
t
.
bigint
"group_id"
,
null:
false
t
.
bigint
"account_id"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
index
[
"account_id"
,
"group_id"
],
name:
"index_group_removed_accounts_on_account_id_and_group_id"
,
unique:
true
t
.
index
[
"account_id"
],
name:
"index_group_removed_accounts_on_account_id"
t
.
index
[
"group_id"
,
"account_id"
],
name:
"index_group_removed_accounts_on_group_id_and_account_id"
t
.
index
[
"group_id"
],
name:
"index_group_removed_accounts_on_group_id"
end
create_table
"groups"
,
force: :cascade
do
|
t
|
create_table
"groups"
,
force: :cascade
do
|
t
|
t
.
bigint
"account_id"
t
.
bigint
"account_id"
t
.
string
"title"
,
null:
false
t
.
string
"title"
,
null:
false
...
@@ -645,8 +656,8 @@ ActiveRecord::Schema.define(version: 2019_06_07_000211) do
...
@@ -645,8 +656,8 @@ ActiveRecord::Schema.define(version: 2019_06_07_000211) do
create_table
"status_pins"
,
force: :cascade
do
|
t
|
create_table
"status_pins"
,
force: :cascade
do
|
t
|
t
.
bigint
"account_id"
,
null:
false
t
.
bigint
"account_id"
,
null:
false
t
.
bigint
"status_id"
,
null:
false
t
.
bigint
"status_id"
,
null:
false
t
.
datetime
"created_at"
,
default:
->
{
"
now()
"
},
null:
false
t
.
datetime
"created_at"
,
default:
->
{
"
CURRENT_TIMESTAMP
"
},
null:
false
t
.
datetime
"updated_at"
,
default:
->
{
"
now()
"
},
null:
false
t
.
datetime
"updated_at"
,
default:
->
{
"
CURRENT_TIMESTAMP
"
},
null:
false
t
.
index
[
"account_id"
,
"status_id"
],
name:
"index_status_pins_on_account_id_and_status_id"
,
unique:
true
t
.
index
[
"account_id"
,
"status_id"
],
name:
"index_status_pins_on_account_id_and_status_id"
,
unique:
true
end
end
...
@@ -849,6 +860,8 @@ ActiveRecord::Schema.define(version: 2019_06_07_000211) do
...
@@ -849,6 +860,8 @@ ActiveRecord::Schema.define(version: 2019_06_07_000211) do
add_foreign_key
"follows"
,
"accounts"
,
name:
"fk_32ed1b5560"
,
on_delete: :cascade
add_foreign_key
"follows"
,
"accounts"
,
name:
"fk_32ed1b5560"
,
on_delete: :cascade
add_foreign_key
"group_accounts"
,
"accounts"
,
on_delete: :cascade
add_foreign_key
"group_accounts"
,
"accounts"
,
on_delete: :cascade
add_foreign_key
"group_accounts"
,
"groups"
,
on_delete: :cascade
add_foreign_key
"group_accounts"
,
"groups"
,
on_delete: :cascade
add_foreign_key
"group_removed_accounts"
,
"accounts"
,
on_delete: :cascade
add_foreign_key
"group_removed_accounts"
,
"groups"
,
on_delete: :cascade
add_foreign_key
"identities"
,
"users"
,
name:
"fk_bea040f377"
,
on_delete: :cascade
add_foreign_key
"identities"
,
"users"
,
name:
"fk_bea040f377"
,
on_delete: :cascade
add_foreign_key
"imports"
,
"accounts"
,
name:
"fk_6db1b6e408"
,
on_delete: :cascade
add_foreign_key
"imports"
,
"accounts"
,
name:
"fk_6db1b6e408"
,
on_delete: :cascade
add_foreign_key
"invites"
,
"users"
,
on_delete: :cascade
add_foreign_key
"invites"
,
"users"
,
on_delete: :cascade
...
...
spec/fabricators/group_removed_account_fabricator.rb
0 → 100644
View file @
520c125e
Fabricator
(
:group_removed_account
)
do
end
spec/models/group_removed_account_spec.rb
0 → 100644
View file @
520c125e
require
'rails_helper'
RSpec
.
describe
GroupRemovedAccount
,
type: :model
do
pending
"add some examples to (or delete)
#{
__FILE__
}
"
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment