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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/lib/newsitem.rb +17 -24
  3. data/lib/site.rb +4 -3
  4. data/lib/tag.rb +4 -3
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7d20be996fecd2563a6b86d5ebd78f253b8e8f3
4
- data.tar.gz: 4c0578efb741abcbf11d58ed65a20e2d5cd6fcac
3
+ metadata.gz: 7b83dc75d18c75d7d83b8644f5511bf03766303c
4
+ data.tar.gz: c6c2910938f5d396ea82e2e0a156bad42373b24e
5
5
  SHA512:
6
- metadata.gz: bb6c6c31b12ef723dba11c909de33a0bdf8c2cfd14995e1826ac79debb4cc24b9aa49f2ac3f50e55a28dfe5c66428779bea553a7945c5999ceb5915387c76708
7
- data.tar.gz: 5859e0377c1e81e6629f5f7added400598a8e79193723667b683119ce7e621c09400dc7ab3ad78c5fe4db814c5782f9293be174ed4c275361227aa110e4d91e0
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
- =begin
6
- embedded_in :user
7
- embedded_in :site
8
- embedded_in :city
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, :optional => true
10
+ belongs_to :video, :optional => true
18
11
 
19
12
  has_one :photo
20
13
 
21
- field :name, :type => String
22
- field :descr, :type => String
23
- field :image_path, :type => String
24
- field :link_path, :type => String
25
- field :username, :type => String # @TODO do I use this???
26
- field :partial_name, :type => String, :default => nil # @deprecated, but let's not remove it.
27
-
28
- field :weight, :type => Integer, :default => 10
29
- field :n_upvotes, :type => Integer, :default => 0
30
- field :n_downvotes, :type => Integer, :default => 0
31
- field :upvoting_users, :type => Array, :default => []
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, :type => Boolean, :default => false
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, :type => String
13
- field :subhead, :type => String
14
- field :home_redirect_path, :type => String, :default => nil
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, :type => String
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
 
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.52
4
+ version: 0.0.33.53
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox