ish_models 0.0.33.14 → 0.0.33.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/app_model2.rb +1 -1
- data/lib/report.rb +5 -1
- 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: 5ad3b1bbc9b40834687078d507f883a7e49abd21
|
4
|
+
data.tar.gz: 29fdd56426a79b367e2649897bc9b930caf2f8a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f18537c912f1967bdc49a38f9a481721ed50dfef37df84e5e11277dde853ef4c989b39616b040a812ca1f7f146cfa37828deb8898d25eb70f632e9a7f14e7c55
|
7
|
+
data.tar.gz: 81701b1844798ea280098c638ca8591f6d1984e13072fec9fbae8fd43ac73f0823241820e20fa095c221bd9fe034d0eb7e0ec399c303b43747b3c6cfc74f339c
|
data/lib/app_model2.rb
CHANGED
@@ -3,7 +3,7 @@ class AppModel2
|
|
3
3
|
include ::Mongoid::Timestamps
|
4
4
|
|
5
5
|
field :is_feature, :type => Boolean, :default => false
|
6
|
-
field :is_public, :type => Boolean, :default =>
|
6
|
+
field :is_public, :type => Boolean, :default => false
|
7
7
|
field :is_done, :type => Boolean, :default => false
|
8
8
|
field :is_trash, :type => Boolean, :default => false
|
9
9
|
field :is_anonymous, :type => Boolean, :default => false
|
data/lib/report.rb
CHANGED
@@ -108,7 +108,11 @@ class Report
|
|
108
108
|
|
109
109
|
unless doc.city.blank?
|
110
110
|
city = City.find doc.city.id
|
111
|
-
|
111
|
+
if doc.user
|
112
|
+
username = doc.user.username || 'anon'
|
113
|
+
else
|
114
|
+
username = '<username>'
|
115
|
+
end
|
112
116
|
n = Newsitem.new :report => doc, :username => username
|
113
117
|
city.newsitems << n
|
114
118
|
city.save
|