ish_models 0.0.33.137 → 0.0.33.138
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gallery.rb +4 -3
- data/lib/report.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fae967dffb3be2dfc17016af14b8b86e7f3c15e71c042ef6616c03fa7fc1a823
|
4
|
+
data.tar.gz: d4f56b950da547e32832d92c5366bdb352ce88930359253077d7cde3bcc8bd4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c93000c2c58774c2c29e1eef2e7d835778ffe13c9d75e5c1bf1536db481500e315e1975a8c73449da96f933751ff8e3b5d8ae35d07d74f4626084eec745a527
|
7
|
+
data.tar.gz: 15f58894be9232aa874a06b1f62eecb53a8d0edb1da34360f63f98d9e100e0a2fefec36092d3b15de32142ce06ddd13d2f2500193ebed8d2595af5446b413790
|
data/lib/gallery.rb
CHANGED
@@ -25,9 +25,9 @@ class Gallery
|
|
25
25
|
|
26
26
|
field :x, :type => Float
|
27
27
|
field :y, :type => Float
|
28
|
-
field :subhead
|
29
|
-
field :descr, :
|
30
|
-
field :lang, :
|
28
|
+
field :subhead
|
29
|
+
field :descr, :as => :description
|
30
|
+
field :lang, :default => 'en'
|
31
31
|
field :issue
|
32
32
|
field :username
|
33
33
|
|
@@ -35,6 +35,7 @@ class Gallery
|
|
35
35
|
field :slug
|
36
36
|
index({ :slug => -1 }, { :unique => true })
|
37
37
|
validates :slug, presence: true, uniqueness: true
|
38
|
+
before_validation :set_slug, :on => :create
|
38
39
|
|
39
40
|
## @TODO: I should have a redirect service, instead of this specific thing. But only after making $50.
|
40
41
|
# embeds_many :gallery_names, :class_name => '::Ish::GalleryName'
|
data/lib/report.rb
CHANGED
@@ -11,6 +11,7 @@ class Report
|
|
11
11
|
field :slug
|
12
12
|
validates :slug, :uniqueness => true, :presence => true
|
13
13
|
index({ :slug => 1 }, { :unique => true })
|
14
|
+
before_validation :set_slug, :on => :create
|
14
15
|
|
15
16
|
## Can be one of: default (nil), longscroll
|
16
17
|
field :item_type, type: String
|
@@ -97,7 +98,7 @@ class Report
|
|
97
98
|
end
|
98
99
|
end
|
99
100
|
|
100
|
-
|
101
|
+
|
101
102
|
|
102
103
|
set_callback :update, :after do |doc|
|
103
104
|
Site.update_all updated_at: Time.now
|