ish_models 0.0.33.52 → 0.0.33.53
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/newsitem.rb +17 -24
- data/lib/site.rb +4 -3
- data/lib/tag.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b83dc75d18c75d7d83b8644f5511bf03766303c
|
4
|
+
data.tar.gz: c6c2910938f5d396ea82e2e0a156bad42373b24e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56afea3d4a6e9a3add2559a08a77c7044a9d7467da059e6010e97a5e90a46647736d1e0921efad92b815bf0943857bd101e5588296db9cdfc3511858a65ff354
|
7
|
+
data.tar.gz: a5315848ffb25d28c0702931dc37b969eceff04f8a591ec5fe9722bc46bd3811f8ac432b8754c5d523fbb4bca91bb0b3810a4d43c8c87b3076c2c9d61f398652
|
data/lib/newsitem.rb
CHANGED
@@ -2,35 +2,28 @@ class Newsitem
|
|
2
2
|
include Mongoid::Document
|
3
3
|
include Mongoid::Timestamps
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
embedded_in :tag
|
10
|
-
=end
|
11
|
-
|
12
|
-
belongs_to :site, :optional => true
|
13
|
-
belongs_to :city, :optional => true
|
14
|
-
|
15
|
-
belongs_to :report, :optional => true
|
5
|
+
belongs_to :site, :optional => true
|
6
|
+
belongs_to :tag, :optional => true
|
7
|
+
belongs_to :city, :optional => true
|
8
|
+
belongs_to :report, :optional => true
|
16
9
|
belongs_to :gallery, :optional => true
|
17
|
-
belongs_to :video,
|
10
|
+
belongs_to :video, :optional => true
|
18
11
|
|
19
12
|
has_one :photo
|
20
13
|
|
21
|
-
field :name
|
22
|
-
field :descr
|
23
|
-
field :image_path
|
24
|
-
field :link_path
|
25
|
-
field :username
|
26
|
-
field :partial_name
|
27
|
-
|
28
|
-
field :weight,
|
29
|
-
field :n_upvotes,
|
30
|
-
field :n_downvotes,
|
31
|
-
field :upvoting_users,
|
14
|
+
field :name
|
15
|
+
field :descr
|
16
|
+
field :image_path
|
17
|
+
field :link_path
|
18
|
+
field :username
|
19
|
+
field :partial_name
|
20
|
+
|
21
|
+
field :weight, :type => Integer, :default => 10
|
22
|
+
field :n_upvotes, :type => Integer, :default => 0
|
23
|
+
field :n_downvotes, :type => Integer, :default => 0
|
24
|
+
field :upvoting_users, :type => Array, :default => []
|
32
25
|
field :downvoting_users, :type => Array, :default => []
|
33
|
-
field :is_feature,
|
26
|
+
field :is_feature, :type => Boolean, :default => false
|
34
27
|
|
35
28
|
default_scope ->{ order_by({ :created_at => :desc }) }
|
36
29
|
|
data/lib/site.rb
CHANGED
@@ -9,9 +9,10 @@ class Site
|
|
9
9
|
field :lang, :type => String, :default => 'en'
|
10
10
|
# validates :lang, { :uniqueness => :true, :scope => :domain }
|
11
11
|
|
12
|
-
field :title
|
13
|
-
field :subhead
|
14
|
-
field :
|
12
|
+
field :title
|
13
|
+
field :subhead
|
14
|
+
field :description
|
15
|
+
field :home_redirect_path
|
15
16
|
|
16
17
|
field :n_features, :type => Integer, :default => 4
|
17
18
|
field :n_newsitems, :type => Integer, :default => 20
|
data/lib/tag.rb
CHANGED
@@ -5,9 +5,9 @@ class Tag
|
|
5
5
|
field :name, :type => String
|
6
6
|
validates :name, :uniqueness => true, :allow_nil => false
|
7
7
|
|
8
|
-
field :name_seo, :
|
8
|
+
field :name_seo, :as => :tagname
|
9
9
|
validates :name_seo, :uniqueness => true, :allow_nil => false
|
10
|
-
|
10
|
+
|
11
11
|
field :descr, :type => String, :default => ''
|
12
12
|
|
13
13
|
field :is_public, :type => Boolean, :default => true
|
@@ -24,7 +24,8 @@ class Tag
|
|
24
24
|
belongs_to :parent_tag, :class_name => 'Tag', :inverse_of => :children_tags, :optional => true
|
25
25
|
|
26
26
|
embeds_many :features
|
27
|
-
embeds_many :newsitems
|
27
|
+
# embeds_many :newsitems
|
28
|
+
has_many :newsitems
|
28
29
|
|
29
30
|
belongs_to :site, :optional => true
|
30
31
|
|