mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
You never know.
This commit is contained in:
parent
7e2ee59186
commit
a1023948f8
3 changed files with 22 additions and 0 deletions
12
migrations/071_banned_referrers.rb
Normal file
12
migrations/071_banned_referrers.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
Sequel.migration do
|
||||||
|
up {
|
||||||
|
DB.create_table! :banned_referrers do
|
||||||
|
primary_key :id
|
||||||
|
String :name
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
down {
|
||||||
|
DB.drop_table :banned_referrers
|
||||||
|
}
|
||||||
|
end
|
9
migrations/072_banned_commenting.rb
Normal file
9
migrations/072_banned_commenting.rb
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Sequel.migration do
|
||||||
|
up {
|
||||||
|
DB.add_column :sites, :commenting_banned, :boolean, default: false
|
||||||
|
}
|
||||||
|
|
||||||
|
down {
|
||||||
|
DB.drop_column :sites, :commenting_banned
|
||||||
|
}
|
||||||
|
end
|
|
@ -496,6 +496,7 @@ class Site < Sequel::Model
|
||||||
=end
|
=end
|
||||||
|
|
||||||
def commenting_allowed?
|
def commenting_allowed?
|
||||||
|
return false if owner.commenting_banned == true
|
||||||
return true if owner.commenting_allowed
|
return true if owner.commenting_allowed
|
||||||
|
|
||||||
if owner.supporter?
|
if owner.supporter?
|
||||||
|
|
Loading…
Add table
Reference in a new issue