ish_models 0.0.33.116 → 0.0.33.121
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/city.rb +1 -1
- data/lib/gallery.rb +5 -3
- data/lib/newsitem.rb +2 -0
- data/lib/tag.rb +4 -4
- data/lib/venue.rb +2 -0
- data/lib/video.rb +3 -3
- 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: 4b574fae4d9d623f6a4c607caf3282693b8eab0b4e1c1a96680b96f5c1c9596f
|
4
|
+
data.tar.gz: 9f02341af99ebd3a6c3cd94e30b4241a8d67ca77e73db7514d72a300dd635e52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd264b75c5a2c013bb028005c1bfb3e0440837c36248cb4c5902b440010bfc4f92e92c6983c7896557fd9570513f8c7993f7dff200049eb527f5b13aa879877d
|
7
|
+
data.tar.gz: 879928f0e97a2db21dc54ce929e273a77cc0eeec515122256479f9c505b9dc66599dfce118489c77f2f5dcf29025f41fed5e3ad73fa7d4a57b1250bfa51153c6
|
data/lib/city.rb
CHANGED
data/lib/gallery.rb
CHANGED
@@ -4,6 +4,8 @@ class Gallery
|
|
4
4
|
include ::Mongoid::Document
|
5
5
|
include ::Mongoid::Timestamps
|
6
6
|
|
7
|
+
PER_PAGE = 6
|
8
|
+
|
7
9
|
field :is_public, type: Boolean, default: false
|
8
10
|
field :is_trash, type: Boolean, default: false
|
9
11
|
|
@@ -47,7 +49,7 @@ class Gallery
|
|
47
49
|
|
48
50
|
has_many :photos
|
49
51
|
|
50
|
-
|
52
|
+
has_and_belongs_to_many :tags
|
51
53
|
belongs_to :city, :optional => true
|
52
54
|
belongs_to :venue, :optional => true
|
53
55
|
|
@@ -107,8 +109,8 @@ class Gallery
|
|
107
109
|
|
108
110
|
field :issue
|
109
111
|
|
110
|
-
RENDER_TITLES = '
|
111
|
-
RENDER_THUMBS = '
|
112
|
+
RENDER_TITLES = 'index_titles' # view name
|
113
|
+
RENDER_THUMBS = 'index_thumbs' # view name
|
112
114
|
|
113
115
|
belongs_to :newsparent, polymorphic: true, optional: true
|
114
116
|
|
data/lib/newsitem.rb
CHANGED
data/lib/tag.rb
CHANGED
@@ -16,10 +16,6 @@ class Tag
|
|
16
16
|
|
17
17
|
field :weight, :type => Integer, :default => 10
|
18
18
|
|
19
|
-
has_and_belongs_to_many :reports
|
20
|
-
has_many :galleries
|
21
|
-
has_many :videos
|
22
|
-
|
23
19
|
has_many :children_tags, :class_name => 'Tag', :inverse_of => :parent_tag
|
24
20
|
belongs_to :parent_tag, :class_name => 'Tag', :inverse_of => :children_tags, :optional => true
|
25
21
|
|
@@ -31,6 +27,10 @@ class Tag
|
|
31
27
|
belongs_to :city, :optional => true
|
32
28
|
|
33
29
|
has_and_belongs_to_many :venues
|
30
|
+
has_and_belongs_to_many :cities
|
31
|
+
has_and_belongs_to_many :galleries
|
32
|
+
has_and_belongs_to_many :reports
|
33
|
+
has_and_belongs_to_many :videos
|
34
34
|
|
35
35
|
default_scope ->{
|
36
36
|
where({ :is_public => true, :is_trash => false }).order_by({ :name => :asc })
|
data/lib/venue.rb
CHANGED
data/lib/video.rb
CHANGED
@@ -22,14 +22,14 @@ class Video
|
|
22
22
|
field :youtube_id, :type => String
|
23
23
|
# validates :youtube_id, :uniqueness => true, :presence => true
|
24
24
|
|
25
|
-
|
25
|
+
has_and_belongs_to_many :tags
|
26
26
|
belongs_to :city, :optional => true
|
27
27
|
belongs_to :site, :optional => true
|
28
|
-
has_many :newsitems
|
28
|
+
# has_many :newsitems # unnecessary, right? _vp_ 20200412
|
29
29
|
|
30
30
|
belongs_to :user_profile, :optional => true, :class_name => 'IshModels::UserProfile', :inverse_of => :videos
|
31
31
|
|
32
|
-
accepts_nested_attributes_for :site, :
|
32
|
+
accepts_nested_attributes_for :site, :tags, :city
|
33
33
|
|
34
34
|
def self.list
|
35
35
|
[['', nil]] + Video.unscoped.order_by( :created_at => :desc ).map { |item| [ "#{item.created_at.strftime('%Y%m%d')} #{item.name}", item.id ] }
|