ish_models 0.0.33.8 → 0.0.33.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5e17a67ebc32d4a8e87920c29938f7e1e20fb6c
4
- data.tar.gz: cf59f01cb03dff491afe50d3e1c3fe85a3c9feb0
3
+ metadata.gz: fb4f14c168d2c1cf2ceb0c391b6e0b3c819b821c
4
+ data.tar.gz: da7f19fbab2cc5b70b820d198a978a8bc78ee7cb
5
5
  SHA512:
6
- metadata.gz: f2c9b9e2bc58179682c94c785ac97cdb74a1b0896c835c7059c3be50628f3b2f4aa2c28eb9a8178c2618ad3f123c6a202356ed1fb0ec3d95531fc0bae6148fc4
7
- data.tar.gz: 6942979a180e7c202ec4c06c8d63188841eb97d017c9b8daf30a3253d0508a44e1531ce8bf35d96acdd1e7d0e6bab66b1b0ce2ea392c4299e20d46262682b438
6
+ metadata.gz: 97e8e603a109a01f58333d817a32f459d2e8467618848ff6b31716ac518b4a4f62812975f1750365a4cb6b231ecfa0ad8bc655aedc2e8648fe7c8962cbe88f0c
7
+ data.tar.gz: 5402c71cdf0c6b7a813b37f1872d940333cb0cf5a262cebdbc911d78573616a3eaab74c942e42628b4ef8d119013456b9e5a8debbcdd64e57967ba78ee8ea8bf
data/lib/gallery.rb CHANGED
@@ -17,13 +17,10 @@ class Gallery < AppModel2
17
17
  field :descr, :type => String
18
18
  field :lang, :type => String, :default => 'en'
19
19
 
20
- # not necessary because AppModel2
21
- # default_scope ->{ where( :is_public => true, :is_trash => false ).order_by( :created_at => :desc ) }
22
-
23
20
  has_many :photos
24
21
 
25
- belongs_to :tag, :optional => true
26
- belongs_to :city, :optional => true
22
+ belongs_to :tag, :optional => true
23
+ belongs_to :city, :optional => true
27
24
  belongs_to :venue, :optional => true
28
25
 
29
26
  has_many :newsitems
@@ -34,6 +31,9 @@ class Gallery < AppModel2
34
31
  end
35
32
  doc.galleryname = doc.id.to_s
36
33
 
34
+ #
35
+ # newsitems
36
+ #
37
37
  if doc.is_public
38
38
  # for the sites
39
39
  if doc.site
@@ -49,7 +49,6 @@ class Gallery < AppModel2
49
49
  end
50
50
  end
51
51
  end
52
-
53
52
  # for the city
54
53
  if doc.city
55
54
  n = Newsitem.new {}
@@ -59,6 +58,17 @@ class Gallery < AppModel2
59
58
  n.save
60
59
  end
61
60
  end
61
+
62
+ #
63
+ # cache
64
+ #
65
+ if doc.site
66
+ doc.site.touch
67
+ end
68
+ if doc.city
69
+ doc.city.touch
70
+ end
71
+
62
72
  end
63
73
 
64
74
  # @deprecated, use Gallery::ACTIONS
@@ -74,7 +74,7 @@ class IshModels::User
74
74
 
75
75
  has_many :reports
76
76
  has_many :photos
77
- has_many :user_profiles
77
+ # has_many :user_profiles
78
78
  has_many :galleries
79
79
  has_many :videos
80
80
 
@@ -1,4 +1,4 @@
1
- class UserProfile
1
+ class IshModels::UserProfile
2
2
  include Mongoid::Document
3
3
  include Mongoid::Timestamps
4
4
 
data/lib/ish_models.rb CHANGED
@@ -19,6 +19,7 @@ end
19
19
 
20
20
  require 'ish_models/cache_key.rb'
21
21
  require 'ish_models/user.rb'
22
+ require 'ish_models/user_profile.rb'
22
23
 
23
24
  require 'app_model2.rb'
24
25
  require 'aux_model.rb'
@@ -35,6 +36,5 @@ require 'public_item.rb'
35
36
  require 'report.rb'
36
37
  require 'site.rb'
37
38
  require 'tag.rb'
38
- require 'user_profile.rb'
39
39
  require 'venue.rb'
40
40
  require 'video.rb'
data/lib/tag.rb CHANGED
@@ -1,6 +1,4 @@
1
-
2
- class Tag
3
-
1
+ class Tag
4
2
  include Mongoid::Document
5
3
  include Mongoid::Timestamps
6
4
 
@@ -23,13 +21,12 @@ class Tag
23
21
  has_many :videos
24
22
 
25
23
  has_many :children_tags, :class_name => 'Tag', :inverse_of => :parent_tag
26
- belongs_to :parent_tag, :class_name => 'Tag', :inverse_of => :children_tags
24
+ belongs_to :parent_tag, :class_name => 'Tag', :inverse_of => :children_tags, :optional => true
27
25
 
28
26
  embeds_many :features
29
27
  embeds_many :newsitems
30
28
 
31
- belongs_to :site
32
- validates :site, :presence => true
29
+ belongs_to :site, :optional => true
33
30
 
34
31
  default_scope ->{
35
32
  where({ :is_public => true, :is_trash => false }).order_by({ :name => :asc })
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.8
4
+ version: 0.0.33.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -72,6 +72,7 @@ files:
72
72
  - lib/ish_models/railtie.rb~
73
73
  - lib/ish_models/user.rb
74
74
  - lib/ish_models/user.rb~
75
+ - lib/ish_models/user_profile.rb
75
76
  - lib/manager.rb
76
77
  - lib/newsitem.rb
77
78
  - lib/photo.rb
@@ -79,7 +80,6 @@ files:
79
80
  - lib/report.rb
80
81
  - lib/site.rb
81
82
  - lib/tag.rb
82
- - lib/user_profile.rb
83
83
  - lib/venue.rb
84
84
  - lib/video.rb
85
85
  homepage: http://wasya.co