friendly urls
This commit is contained in:
@@ -26,6 +26,10 @@ class Blogpost < ActiveRecord::Base
|
||||
!!user_editor_id
|
||||
end
|
||||
|
||||
def to_s
|
||||
title
|
||||
end
|
||||
|
||||
def send_new_mention_mail(old_content = "")
|
||||
new_mentions = mentions(content) - mentions(old_content)
|
||||
mails = []
|
||||
@@ -42,4 +46,7 @@ class Blogpost < ActiveRecord::Base
|
||||
background_mailer(mails)
|
||||
end
|
||||
|
||||
def to_param
|
||||
[id, to_s.parameterize].join("-")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -23,4 +23,8 @@ class Forum < ActiveRecord::Base
|
||||
def can_write?(user)
|
||||
group.can_write?(user) && can_read?(user) && (role_write.nil? || (!user.nil? && user.role >= role_write))
|
||||
end
|
||||
|
||||
def to_param
|
||||
[id, to_s.parameterize].join("-")
|
||||
end
|
||||
end
|
||||
@@ -20,4 +20,8 @@ class Forumgroup < ActiveRecord::Base
|
||||
def can_write?(user)
|
||||
!user.nil? && can_read?(user) && user.confirmed? && (role_write.nil? || user.role >= role_write)
|
||||
end
|
||||
|
||||
def to_param
|
||||
[id, to_s.parameterize].join("-")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -57,4 +57,8 @@ class Forumthread < ActiveRecord::Base
|
||||
end
|
||||
background_mailer(mails)
|
||||
end
|
||||
|
||||
def to_param
|
||||
[id, to_s.parameterize].join("-")
|
||||
end
|
||||
end
|
||||
@@ -3,4 +3,12 @@ class Info < ActiveRecord::Base
|
||||
|
||||
validates_presence_of :title, :content
|
||||
|
||||
def to_s
|
||||
title
|
||||
end
|
||||
|
||||
def to_param
|
||||
[id, to_s.parameterize].join("-")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -80,6 +80,10 @@ class User < ActiveRecord::Base
|
||||
return image_tag("https://minotar.net/helm/#{CGI.escape(self.ign)}/#{CGI.escape(size.to_s)}", options)
|
||||
end
|
||||
|
||||
def to_s
|
||||
ign
|
||||
end
|
||||
|
||||
|
||||
|
||||
#check if this user is an idiot and uses their mc password.
|
||||
@@ -176,6 +180,10 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
|
||||
def to_param
|
||||
[id, to_s.parameterize].join("-")
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user