Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update channel_name maker

  • Loading branch information...
commit 2ec70df084f98fd475f5be88039f9737984136f3 1 parent 8bc1a4e
@miksago miksago authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 app/models/list.rb
View
8 app/models/list.rb
@@ -31,12 +31,16 @@ def as_json(options=nil)
end
def channel_name
- @channel_name ||= "list-#{Rails.env}-#{self.token}"
+ @channel_name ||= "list-#{Rails.env}-#{strip_for_channel_name(self.token)}"
end
private
def create_token
- self.token = ActiveSupport::SecureRandom.base64(8).gsub("/","").gsub("+","").gsub(/=+$/,"")
+ self.token = strip_for_channel_name(ActiveSupport::SecureRandom.base64(8))
+ end
+
+ def strip_for_channel_name(str)
+ str.gsub("/","").gsub("+","").gsub(/=+$/,"")
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.