ish_models 0.0.33.138 → 0.0.33.139

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gallery.rb +0 -1
  3. data/lib/ish/utils.rb +5 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fae967dffb3be2dfc17016af14b8b86e7f3c15e71c042ef6616c03fa7fc1a823
4
- data.tar.gz: d4f56b950da547e32832d92c5366bdb352ce88930359253077d7cde3bcc8bd4d
3
+ metadata.gz: ca15ab4eb3ebc3e6a6ea6766fa2b80281bcf89eefe3efd35ac7e531545147e6f
4
+ data.tar.gz: ccd4b15972edb2bd61320bd17e2b3443062130f532d460fe2fd6185722d649e1
5
5
  SHA512:
6
- metadata.gz: 5c93000c2c58774c2c29e1eef2e7d835778ffe13c9d75e5c1bf1536db481500e315e1975a8c73449da96f933751ff8e3b5d8ae35d07d74f4626084eec745a527
7
- data.tar.gz: 15f58894be9232aa874a06b1f62eecb53a8d0edb1da34360f63f98d9e100e0a2fefec36092d3b15de32142ce06ddd13d2f2500193ebed8d2595af5446b413790
6
+ metadata.gz: 650afa1a9f2a769facc5361560dc94436793fca21992532348a48bcaf5c4fc627194221a4527700034613cedba247d2dcf9d490b2c3e0dbe54038b905efcee8a
7
+ data.tar.gz: 803f1bcbb5bad0ac64125fd3d370ff9da205f7ba231b29b276c67b2f8648d30be064f6cc29bf213300001f57993e94ca5a0eb3dace6e4e277c08490714c2c619
data/lib/gallery.rb CHANGED
@@ -31,7 +31,6 @@ class Gallery
31
31
  field :issue
32
32
  field :username
33
33
 
34
- ## @TODO: this is still not autogenerated
35
34
  field :slug
36
35
  index({ :slug => -1 }, { :unique => true })
37
36
  validates :slug, presence: true, uniqueness: true
data/lib/ish/utils.rb CHANGED
@@ -5,7 +5,11 @@ module Ish::Utils
5
5
 
6
6
  def set_slug
7
7
  return if slug
8
- new_slug = name.downcase.gsub(/[^a-z0-9\s]/i, '').gsub(' ', '-')
8
+ if name
9
+ new_slug = name.downcase.gsub(/[^a-z0-9\s]/i, '').gsub(' ', '-')
10
+ else
11
+ new_slug = '1'
12
+ end
9
13
  if self.class.where( slug: new_slug ).first
10
14
  loop do
11
15
  if new_slug[new_slug.length-1].to_i != 0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33.138
4
+ version: 0.0.33.139
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox