ish_models 0.0.33.21 → 0.0.33.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ish_models/user_profile.rb +7 -3
- data/lib/report.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: 0db35e1d9972acc020cca3745c1be3e9b1723248
|
4
|
+
data.tar.gz: c4a382376aa8339603c40a3757df05cb7dd6f1c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ae3bf45d6115fc4e144ec04feb0213db54297cdd26720ba304639741f685b024c3101b0bd23d67ae209ffebfe2cd10cbf4b0361d974da4a0da2a66c464485c0
|
7
|
+
data.tar.gz: b5426e543e0cc2711430f94d1da0a919f0a580f2cf0d532be6ccc069e35f510475b38fb9aad105e66f52207f36be042f065dffd65c5aa63f21dbb030e23efcdb
|
@@ -7,6 +7,7 @@ class IshModels::UserProfile
|
|
7
7
|
field :email
|
8
8
|
|
9
9
|
field :fb_access_token
|
10
|
+
field :fb_long_access_token
|
10
11
|
|
11
12
|
field :about, :type => String
|
12
13
|
field :education, :type => String
|
@@ -18,16 +19,19 @@ class IshModels::UserProfile
|
|
18
19
|
field :doc_resume_path, :type => String
|
19
20
|
|
20
21
|
field :lang, :type => String
|
21
|
-
|
22
|
+
|
23
|
+
ROLES = [ :admin, :manager, :guy ]
|
24
|
+
field :role_name, :type => Symbol
|
25
|
+
|
22
26
|
belongs_to :user
|
23
27
|
belongs_to :current_city, :class_name => 'City', :inverse_of => :current_users, :optional => true
|
24
28
|
belongs_to :guide_city, :class_name => 'City', :inverse_of => :guide, :optional => true
|
25
29
|
|
26
30
|
has_many :galleries
|
27
|
-
has_many :reports
|
31
|
+
has_many :reports, :inverse_of => :profile
|
28
32
|
has_many :videos
|
29
33
|
|
30
|
-
def
|
34
|
+
def sudoer?
|
31
35
|
%w( piousbox@gmail.com manager@gmail.com ).include?( self.user.email ) ? true : false
|
32
36
|
end
|
33
37
|
|
data/lib/report.rb
CHANGED
@@ -34,7 +34,8 @@ class Report
|
|
34
34
|
field :lang, :type => String, :default => 'en'
|
35
35
|
index({ :lang => 1 })
|
36
36
|
|
37
|
-
belongs_to :
|
37
|
+
belongs_to :profile, :optional => true, :class_name => 'IshModels::UserProfile'
|
38
|
+
|
38
39
|
# validates :user, :presence => true, :allow_nil => false
|
39
40
|
field :username, :type => String, :default => 'anonymous'
|
40
41
|
validates :username, :presence => true, :allow_nil => false
|
@@ -108,8 +109,8 @@ class Report
|
|
108
109
|
|
109
110
|
unless doc.city.blank?
|
110
111
|
city = City.find doc.city.id
|
111
|
-
if doc.
|
112
|
-
username = doc.
|
112
|
+
if doc.profile
|
113
|
+
username = doc.profile.username || 'anon'
|
113
114
|
else
|
114
115
|
username = '<username>'
|
115
116
|
end
|