ish_models 0.0.31 → 0.0.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gallery.rb +22 -11
  3. data/lib/ish_models.rb +1 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f16c35ed3fc7b44581a02934673f0280ce18890b
4
- data.tar.gz: 70fb6987337c420c4389495c2a4b1b5fd87d5cdf
3
+ metadata.gz: 2969237ff16d6f14db37047fb60204f1d4c0ecc2
4
+ data.tar.gz: 8c4d6a25f815a676736d0e1c1d6572cec7640bd2
5
5
  SHA512:
6
- metadata.gz: f51c9143bb4491e867a2b79908558c93d7efb5ba2c4cacaf643d9dc48fabc83ad8e1ccc953072c0887d5b269febe8e2a0382492947900132c56de06f9d15f3a5
7
- data.tar.gz: 081082d09d1871da3ca18f84a691860ea599261c1a62f20ee4bc20f6adce692f9232e90dde733028ccd0d46f6120994e68bf3d2d146ed17a864e7f738aaad8c7
6
+ metadata.gz: 9f855acb9639155a8a0e1edd7eeece6f943449cefcabe496865754e93ce478ae4716b5fced45cdf0ed85ab73f5322c57d3b5822348d116a8946c8249b6030f0a
7
+ data.tar.gz: 5f8889ff575b4433f3d34e795253d191192110bb30277af1b0cb2a6bfe7fd8872da5d7231049dc649b29fd2f2249589ea0824cf9f6664d0927ba285279d68597
data/lib/gallery.rb CHANGED
@@ -32,19 +32,30 @@ class Gallery < AppModel2
32
32
  doc.username = doc.user.username
33
33
  doc.galleryname = doc.name.to_simple_string
34
34
 
35
- # for the homepage
36
- if doc.is_public && doc.site
37
- n = Newsitem.new {}
38
- n.gallery = doc
39
- n.username = doc.user.username
40
- sites = Site.where( :domain => doc.site.domain )
41
- sites.each do |site|
42
- site.newsitems << n
43
- flag = site.save
44
- if !flag
45
- puts! site.errors
35
+ if doc.is_public
36
+ # for the sites
37
+ if doc.site
38
+ sites = Site.where( :domain => doc.site.domain )
39
+ sites.each do |site|
40
+ n = Newsitem.new {}
41
+ n.gallery = doc
42
+ n.username = doc.username
43
+ site.newsitems << n
44
+ flag = site.save
45
+ if !flag
46
+ puts! site.errors
47
+ end
46
48
  end
47
49
  end
50
+
51
+ # for the city
52
+ if doc.city
53
+ n = Newsitem.new {}
54
+ n.gallery = doc
55
+ n.city = doc.city
56
+ n.username = doc.username
57
+ n.save
58
+ end
48
59
  end
49
60
  end
50
61
 
data/lib/ish_models.rb CHANGED
@@ -1,8 +1,7 @@
1
1
 
2
2
  require 'ish_models/railtie' if defined?(Rails)
3
- # require 'ish_models/configuration'
3
+ require 'ish_models/configuration'
4
4
 
5
- =begin
6
5
  module IshModels
7
6
 
8
7
  class << self
@@ -17,7 +16,6 @@ module IshModels
17
16
  yield(configuration)
18
17
  end
19
18
  end
20
- =end
21
19
 
22
20
  require 'ish_models/cache_key.rb'
23
21
  require 'ish_models/user.rb'
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.31
4
+ version: 0.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox