ish_models 0.0.33.164 → 0.0.33.168

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a783500814f32b8c34ef3feade0aef48169ea390eb033422518593edef4cf67b
4
- data.tar.gz: ae18235c6b0862be5e0d09b53c86002d1bf76824d17391b2a4507749f358d911
3
+ metadata.gz: f231fd1652da3cd2e8113a7963919aa0148becd53e53efc85d4cb8c2d45eddd0
4
+ data.tar.gz: 77ef4b9331ef224679c2c3000e0738bba4e51be462bbddf854dc4c04c9338f80
5
5
  SHA512:
6
- metadata.gz: 4522756a1cedf0b0a570e13ad1a35dda926930aadbb7dbe5112de03923b3c5f133ee1e0c569639bf01fccb4be7926a82d406523c8ef1fe2c18705c9bc93e70be
7
- data.tar.gz: 45b1305bdb9395f37325d78183d746ff7c9c2f6a9bb01ca533dc56b11ac176816cf9ad01b612d58514ff43e7ea0395b126b7fe682ae4a81fcd4091420493d591
6
+ metadata.gz: a26b8edb378762eb22caca40ebe5ee895dc16cb563332431b964769d94c87bb0873312c153a40cc162e779daf60db0085452ce46a6459c0c81f3a9dafe24dc77
7
+ data.tar.gz: 2c6ebe91cefc06019d5090ded6f04bd95389002dc765cb359f3efdb46ab5092a72cbfd3202d6987283ae0a7aaa0590697976f0cae9d0abe1ecc87d3142970905
@@ -0,0 +1,29 @@
1
+
2
+ require 'aws-sdk'
3
+
4
+ class ::Gameui::Asset3d
5
+ include Mongoid::Document
6
+ include Mongoid::Timestamps
7
+ include Mongoid::Paperclip
8
+ include Ish::Utils
9
+
10
+ belongs_to :marker, class_name: 'Gameui::Marker', optional: true
11
+
12
+ has_mongoid_attached_file :object,
13
+ :storage => :s3,
14
+ :s3_credentials => ::S3_CREDENTIALS,
15
+ :path => "assets3d/:id/:filename",
16
+ :s3_protocol => 'https',
17
+ :validate_media_type => false,
18
+ s3_region: ::S3_CREDENTIALS[:region]
19
+
20
+ do_not_validate_attachment_file_type :object
21
+
22
+ def export_fields
23
+ %w|
24
+ marker_id
25
+ asset3d_file_name asset3d_content_type asset3d_file_size asset3d_updated_at asset3d_fingerprint
26
+ |;
27
+ end
28
+
29
+ end
data/lib/gameui/marker.rb CHANGED
@@ -7,8 +7,12 @@ class ::Gameui::Marker
7
7
  field :name, type: String
8
8
  validates_uniqueness_of :name, scope: :map_id
9
9
  validates_presence_of :name
10
+
11
+ ## This is not a map, I don't need a slug.
12
+ ## @TODO: remove it. _vp_ 2022-06-17
13
+ field :slug
10
14
  def slug
11
- id.to_s
15
+ return self[:slug] || id.to_s
12
16
  end
13
17
 
14
18
  field :ordering, type: String, default: 'jjj'
@@ -26,6 +30,7 @@ class ::Gameui::Marker
26
30
 
27
31
  has_one :image, class_name: '::Ish::ImageAsset', inverse_of: :marker
28
32
  has_one :title_image, class_name: '::Ish::ImageAsset', inverse_of: :marker_title
33
+ has_one :asset3d, class_name: '::Gameui::Asset3d'
29
34
 
30
35
  field :deleted_at, type: Time, default: nil # @TODO: replace with paranoia
31
36
 
@@ -0,0 +1,11 @@
1
+
2
+ class Ish::Unsubscribe
3
+ include Mongoid::Document
4
+ include Mongoid::Timestamps
5
+
6
+ field :email
7
+ field :unsubscribed_at
8
+ field :reason
9
+
10
+ end
11
+
@@ -31,6 +31,9 @@ class Ish::UserProfile
31
31
  field :lang, default: 'en'
32
32
 
33
33
  ROLES = [ :admin, :manager, :guy ]
34
+ ROLE_ADMIN = :admin
35
+ ROLE_MANAGER = :manager
36
+ ROLE_GUY = :guy
34
37
  field :role_name, :type => Symbol
35
38
 
36
39
  has_one :profile_photo, :class_name => 'Photo', :inverse_of => :profile_city
data/lib/ish_models.rb CHANGED
@@ -26,6 +26,10 @@ module IshModels
26
26
  end
27
27
  end
28
28
 
29
+ # Needs to be before gameui/asset3d
30
+ require 'ish/utils'
31
+
32
+ require 'gameui/asset3d'
29
33
  require 'gameui/map'
30
34
  require 'gameui/map_bookmark'
31
35
  require 'gameui/marker'
@@ -42,7 +46,7 @@ require 'ish/issue'
42
46
  require 'ish/lead'
43
47
  require 'ish/payment'
44
48
  require 'ish/premium_item'
45
- require 'ish/utils'
49
+ require 'ish/unsubscribe'
46
50
  require 'ish/user_profile'
47
51
 
48
52
  require 'city'
data/lib/tag.rb CHANGED
@@ -4,10 +4,10 @@ class Tag
4
4
  include Ish::Utils
5
5
 
6
6
  field :name, :type => String
7
- validates :name, :uniqueness => true, :allow_nil => false
7
+ validates :name, uniqueness: true, presence: true, allow_nil: false # @TODO: tags should only be unique globally, and per-user.
8
8
 
9
9
  field :slug
10
- validates :slug, :uniqueness => true, presence: true, allow_nil: false
10
+ validates :slug, uniqueness: true, presence: true, allow_nil: false
11
11
 
12
12
  field :descr, :type => String, :default => ''
13
13
 
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.164
4
+ version: 0.0.33.168
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -121,6 +121,7 @@ files:
121
121
  - lib/event.rb
122
122
  - lib/feature.rb
123
123
  - lib/gallery.rb
124
+ - lib/gameui/asset3d.rb
124
125
  - lib/gameui/map.rb
125
126
  - lib/gameui/map_bookmark.rb
126
127
  - lib/gameui/marker.rb
@@ -139,6 +140,7 @@ files:
139
140
  - lib/ish/payment.rb
140
141
  - lib/ish/premium_item.rb
141
142
  - lib/ish/railtie.rb
143
+ - lib/ish/unsubscribe.rb
142
144
  - lib/ish/user_profile.rb
143
145
  - lib/ish/utils.rb
144
146
  - lib/ish_models.rb