ish_models 0.0.33.169 → 0.0.33.172

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: 1c0e3408ce26fe3d97602564c99955fa11a05c6584c2cf435a55edbbe2865c63
4
- data.tar.gz: f984f36ddfc7d046a819d9966306d6e31192e008af037c77fad9bf2975557b42
3
+ metadata.gz: b5769b6b8a2b8a37d133dc1f7b189ae2c57dfaa027ac75eeb1504fdf43ea625e
4
+ data.tar.gz: 93bb7323be666fe6c16be74bf092459d371f9b35c393d846e1028a9efcc22dd9
5
5
  SHA512:
6
- metadata.gz: 27f95caf60f39ce446b0b103be69cafc729a41dbd108833aefe5bcd3814ec1bba4499a5ad1943b4f7f4e5f728c798467c52fa60c43b3f37cf87675c61a149eae
7
- data.tar.gz: 5a73b3adfe1953e2a3d84171880472dcfd6fe4bb0dfd615e000b0b7b53aec52eaba17383c6f6aaa73d36e4ba91df652e4d9b36524088eccaf070da893d0b75a5
6
+ metadata.gz: 757dc8e96ba6f354039339b66f85a4e5a6bd7ff34405fd41621216330848bcccbbdf0c3093adea3d9434e06b70aeee1ba452fef5214bebf4483d3a06baba3ef7
7
+ data.tar.gz: 4e9bfc050504f1b79fc19c0ec977bf96ed2ffcd28067457dc1828c3b52d45fe779a0bf2358c258ff81cd954719f31e01c782525c90a672cd8c31f0d74ae99872
data/lib/gameui/map.rb CHANGED
@@ -17,10 +17,11 @@ class ::Gameui::Map
17
17
  field :slug
18
18
  validates :slug, uniqueness: true, presence: true
19
19
 
20
+ # @TODO: remove field, replace with relation. _vp_ 2022-09-13
20
21
  field :parent_slug
21
-
22
22
  belongs_to :parent, class_name: '::Gameui::Map', inverse_of: :childs, optional: true
23
23
  has_many :childs, class_name: '::Gameui::Map', inverse_of: :parent
24
+
24
25
  has_one :image, class_name: '::Ish::ImageAsset', inverse_of: :location
25
26
  belongs_to :creator_profile, class_name: '::Ish::UserProfile', inverse_of: :my_maps
26
27
 
@@ -33,7 +34,7 @@ class ::Gameui::Map
33
34
 
34
35
  field :version, type: String, default: '0.0.0'
35
36
 
36
- ## @TODO: what is this?
37
+ ## @TODO: or self, right? and refactor this, seems N+1. _vp_ 2022-09-13
37
38
  field :map_slug
38
39
  def map
39
40
  ::Gameui::Map.where( slug: map_slug ).first
@@ -59,6 +60,9 @@ class ::Gameui::Map
59
60
  field :h, type: Integer
60
61
  validates :h, presence: true
61
62
 
63
+ MAP_TYPES = [ :map_2d, :map_3d, :map_geospatial, :map_gallery, :map_toc ] ## Mostly not implemented. _vp_ 2022-09-06
64
+ field :map_type, default: :map_2d
65
+
62
66
  ## @TODO: abstract this into a module
63
67
  field :x, :type => Float
64
68
  field :y, :type => Float
@@ -190,7 +190,7 @@ module Mongoid
190
190
  #
191
191
  # @param [Mongoid Object, BSON::ObjectId] voter is Mongoid object the id of the voter who made the vote
192
192
  def vote_value(voter)
193
- voter_id = voter.is_a?(BSON::ObjectId) ? voter : voter.is_a?(String) ? voter : voter.id
193
+ voter_id = voter.is_a?(BSON::ObjectId) ? voter.to_s : voter.is_a?(String) ? voter : voter.id.to_s
194
194
 
195
195
  return :up if up_voter_ids.try(:include?, voter_id)
196
196
  return :down if down_voter_ids.try(:include?, voter_id)
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.169
4
+ version: 0.0.33.172
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox