mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
Fix slug scope per tenant (#323)
This commit is contained in:
committed by
GitHub
parent
09fb156a4e
commit
e301ada94a
@@ -10,7 +10,7 @@ class Board < ApplicationRecord
|
|||||||
validates :name, presence: true, uniqueness: { scope: :tenant_id }
|
validates :name, presence: true, uniqueness: { scope: :tenant_id }
|
||||||
validates :description, length: { in: 0..1024 }, allow_nil: true
|
validates :description, length: { in: 0..1024 }, allow_nil: true
|
||||||
|
|
||||||
friendly_id :name, use: :slugged
|
friendly_id :name, use: :scoped, scope: :tenant_id
|
||||||
|
|
||||||
def sanitize_slug
|
def sanitize_slug
|
||||||
self.slug = self.slug.parameterize
|
self.slug = self.slug.parameterize
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class OAuth < ApplicationRecord
|
|||||||
validates :scope, presence: true
|
validates :scope, presence: true
|
||||||
validates :json_user_email_path, presence: true
|
validates :json_user_email_path, presence: true
|
||||||
|
|
||||||
friendly_id :generate_random_slug, use: :slugged
|
friendly_id :generate_random_slug, use: :scoped, scope: :tenant_id
|
||||||
|
|
||||||
def is_default?
|
def is_default?
|
||||||
tenant_id == nil
|
tenant_id == nil
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class Post < ApplicationRecord
|
|||||||
|
|
||||||
paginates_per Rails.application.posts_per_page
|
paginates_per Rails.application.posts_per_page
|
||||||
|
|
||||||
friendly_id :title, use: :slugged
|
friendly_id :title, use: :scoped, scope: :tenant_id
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def find_with_post_status_in(post_statuses)
|
def find_with_post_status_in(post_statuses)
|
||||||
|
|||||||
Reference in New Issue
Block a user