ish_models 0.0.33.21 → 0.0.33.22

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: 4b67c62354e4af145a25fe1271036d30b2579985
4
- data.tar.gz: 8cdfafa110c22361abb0de8f25f5028b7b7ec8be
3
+ metadata.gz: 0db35e1d9972acc020cca3745c1be3e9b1723248
4
+ data.tar.gz: c4a382376aa8339603c40a3757df05cb7dd6f1c7
5
5
  SHA512:
6
- metadata.gz: 5d82d903c7c686c98167cdcc86dd825b4017d3783b2053ebff167414592366affbda084d437ad8d9427e2b5111d42a06fcca43aff068f35bb8d80ba1efb8851a
7
- data.tar.gz: dc35be249c3f75b0d92422cd095872a5f2f1089e99440ccf8b90199e645fe56e0dd867f3fe212cb2bc93eaebc03f89555839a5141e1df485c1db84c228b4336c
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 manager?
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 :user, :optional => true, :class_name => 'IshModels::User'
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.user
112
- username = doc.user.username || 'anon'
112
+ if doc.profile
113
+ username = doc.profile.username || 'anon'
113
114
  else
114
115
  username = '<username>'
115
116
  end
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.21
4
+ version: 0.0.33.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox