ish_models 0.0.33.118 → 0.0.33.123

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: 121558953571ec7ddccd7fa69e5fc6ac7ae66fb854bf3c3af7a6e863c081d7ef
4
- data.tar.gz: cd512a1f08541937604d4271331f37f08b0612a294ee87b58bc340bc0a8826de
3
+ metadata.gz: 31fd282b0a6e6d8e604f690ae7e230611b68ab921ffc0b9add930579d73b2cac
4
+ data.tar.gz: 58cb6133640e47a728b62c83c1da29c6645b5bc4a61243908ebe22b58ff70533
5
5
  SHA512:
6
- metadata.gz: 6d45ea857448f205f82ee8f3a26b8c758781595ad919ae7befd4bd142744d0806ae0d463abfe5fb591c9cf893bb589d5e3ae3979392eeb3962b3e635c5457b4e
7
- data.tar.gz: ae1f643f25fe548a4dd733f888801373a5e9512e42f6f5e7766c2326114b48510d3658a6ad87e0779c53ac57616cb5ba2d53d4481f5e813e06daeeef4706991e
6
+ metadata.gz: 6d3abd305b8fa9f0698d8f7c9e19c0d6fcd3e7de95763f890b17f8a491c69b9aedec6a83af0d4df2786471422b045fa82a640afd2c79543062667414ab234403
7
+ data.tar.gz: bdf186500c42e3e8f2104c3a571706ab1a0fdce813b7cdfda42dc625f9a8938f2aeecb5f42357d67dc08194ed2d6d6405727fa0640b563c0794c5179ecb68621
data/lib/city.rb CHANGED
@@ -2,7 +2,7 @@ class City
2
2
  include ::Mongoid::Document
3
3
  include ::Mongoid::Timestamps
4
4
  include AuxModel
5
-
5
+
6
6
  field :name, :type => String
7
7
  field :description, :type => String, :default => 'The description of this city'
8
8
 
@@ -21,8 +21,8 @@ class City
21
21
 
22
22
  belongs_to :country, :optional => true
23
23
 
24
- has_many :events
25
- has_many :galleries
24
+ has_many :events
25
+ has_many :galleries
26
26
  has_many :photos
27
27
  has_many :reports
28
28
  has_many :venues
data/lib/gallery.rb CHANGED
@@ -4,8 +4,11 @@ class Gallery
4
4
  include ::Mongoid::Document
5
5
  include ::Mongoid::Timestamps
6
6
 
7
+ PER_PAGE = 6
8
+
7
9
  field :is_public, type: Boolean, default: false
8
10
  field :is_trash, type: Boolean, default: false
11
+ field :is_done, type: Boolean, default: false
9
12
 
10
13
  field :premium_tier, type: Integer, default: 0 # how many stars need to spend, to get access? 0 = free
11
14
  def is_premium
@@ -15,7 +18,7 @@ class Gallery
15
18
  has_many :premium_purchases, class_name: '::Gameui::PremiumPurchase', as: :item
16
19
 
17
20
  default_scope ->{ where({ :is_public => true, :is_trash => false }).order_by({ :created_at => :desc }) }
18
-
21
+
19
22
  field :x, :type => Float
20
23
  field :y, :type => Float
21
24
 
@@ -30,11 +33,11 @@ class Gallery
30
33
  belongs_to :user_profile, :optional => true, :class_name => 'IshModels::UserProfile', :inverse_of => :galleries
31
34
  field :username, :type => String
32
35
  has_and_belongs_to_many :shared_profiles, :class_name => 'IshModels::UserProfile', :inverse_of => :shared_galleries
33
-
34
- field :name, :type => String
36
+
37
+ field :name
35
38
  validates :name, :uniqueness => true # , :allow_nil => false
36
39
 
37
- field :galleryname, :type => String
40
+ field :galleryname
38
41
  index({ :galleryname => -1 }, { :unique => true })
39
42
  embeds_many :gallery_names, :class_name => '::Ish::GalleryName'
40
43
  def self.find_by_slug slug
@@ -62,7 +65,7 @@ class Gallery
62
65
  #
63
66
  # newsitems
64
67
  #
65
- if doc.is_public
68
+ if doc.is_public
66
69
  # for the sites
67
70
  if doc.site
68
71
  sites = Site.where( :domain => doc.site.domain )
@@ -107,14 +110,14 @@ class Gallery
107
110
 
108
111
  field :issue
109
112
 
110
- RENDER_TITLES = 'gallery_render_titles_const' # string b/c transmited over http
111
- RENDER_THUMBS = 'gallery_render_thumbs_const' # string b/c transmited over http
113
+ RENDER_TITLES = 'index_titles' # view name
114
+ RENDER_THUMBS = 'index_thumbs' # view name
112
115
 
113
116
  belongs_to :newsparent, polymorphic: true, optional: true
114
117
 
115
118
  set_callback :update, :after do |doc|
116
119
  Site.update_all updated_at: Time.now
117
120
  end
118
-
121
+
119
122
  end
120
123
 
File without changes
@@ -4,11 +4,8 @@ class ::Gameui::PremiumPurchase
4
4
  include Mongoid::Timestamps
5
5
 
6
6
  belongs_to :user_profile, :class_name => '::IshModels::UserProfile'
7
-
8
- field :purchased_class
9
- field :purchased_id
10
-
11
7
  belongs_to :item, polymorphic: true
12
8
 
13
9
  end
14
10
 
11
+ ::Purchase = ::Gameui::PremiumPurchase
data/lib/ish/payment.rb CHANGED
@@ -8,7 +8,12 @@ class Ish::Payment
8
8
  field :amount, :type => Integer # in cents
9
9
  field :charge, :type => Hash
10
10
  field :email, :type => String
11
-
11
+
12
+ field :client_secret
13
+ field :payment_intent_id
14
+
15
+ field :status, type: Symbol
16
+
12
17
  after_create :compute_paid_invoice_amount
13
18
 
14
19
  protected
data/lib/ish_models.rb CHANGED
@@ -61,7 +61,7 @@ require 'country.rb'
61
61
  require 'event.rb'
62
62
  require 'feature.rb'
63
63
  require 'gallery.rb'
64
- require 'gallery2.rb'
64
+ # require 'gallery2.rb'
65
65
  require 'manager.rb'
66
66
  require 'newsitem.rb'
67
67
  require 'photo.rb'
@@ -1,12 +1,12 @@
1
- class IshModels::UserProfile
1
+ class IshModels::UserProfile
2
2
  include Mongoid::Document
3
3
  include Mongoid::Timestamps
4
-
4
+
5
5
  field :name
6
6
  validates_presence_of :name
7
7
 
8
8
  field :username
9
-
9
+
10
10
  field :email
11
11
  # validates_format_of :email, :with => ::Devise::email_regexp
12
12
  validates_format_of :email,:with => /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/
@@ -14,16 +14,16 @@ class IshModels::UserProfile
14
14
  field :fb_access_token
15
15
  field :fb_long_access_token
16
16
  field :fb_expires_in
17
-
17
+
18
18
  field :lang, :type => String, :default => :en
19
19
 
20
- ROLES = [ :admin, :manager, :guy ]
20
+ ROLES = [ :admin, :manager, :guy ]
21
21
  field :role_name, :type => Symbol
22
22
 
23
23
  belongs_to :user
24
24
  belongs_to :current_city, :class_name => 'City', :inverse_of => :current_users, :optional => true
25
25
  belongs_to :guide_city, :class_name => 'City', :inverse_of => :guide, :optional => true
26
-
26
+
27
27
  has_many :galleries, :inverse_of => :user_profile
28
28
  has_and_belongs_to_many :shared_galleries, :class_name => 'Gallery', :inverse_of => :shared_profiles
29
29
 
@@ -38,6 +38,8 @@ class IshModels::UserProfile
38
38
  has_and_belongs_to_many :friends, :class_name => 'IshModels::UserProfile', :inverse_of => :friendeds
39
39
  has_and_belongs_to_many :friendeds, :class_name => 'IshModels::UserProfile', :inverse_of => :friends
40
40
 
41
+ field :n_unlocks, type: Integer, default: 0
42
+
41
43
  #
42
44
  # preferences
43
45
  #
@@ -75,12 +77,14 @@ class IshModels::UserProfile
75
77
 
76
78
  end
77
79
 
80
+ Profile = IshModels::UserProfile
81
+
78
82
  =begin
79
83
  field :about, :type => String
80
84
  field :education, :type => String
81
85
  field :objectives, :type => String
82
86
  field :current_employment, :type => String
83
- field :past_employment, :type => String
87
+ field :past_employment, :type => String
84
88
  field :pdf_resume_path, :type => String
85
89
  field :doc_resume_path, :type => String
86
90
 
data/lib/newsitem.rb CHANGED
@@ -31,6 +31,8 @@ class Newsitem
31
31
  field :downvoting_users, :type => Array, :default => []
32
32
  field :is_feature, :type => Boolean, :default => false
33
33
 
34
+ PER_PAGE = 6
35
+
34
36
  default_scope ->{ order_by({ :created_at => :desc }) }
35
37
 
36
38
  def self.from_params item
data/lib/tag.rb CHANGED
@@ -1,19 +1,19 @@
1
- class Tag
1
+ class Tag
2
2
  include Mongoid::Document
3
3
  include Mongoid::Timestamps
4
4
 
5
5
  field :name, :type => String
6
6
  # validates :name, :uniqueness => true, :allow_nil => false
7
-
7
+
8
8
  field :name_seo, :as => :tagname
9
9
  validates :name_seo, :uniqueness => true, :allow_nil => false
10
-
10
+
11
11
  field :descr, :type => String, :default => ''
12
-
12
+
13
13
  field :is_public, :type => Boolean, :default => true
14
14
  field :is_trash, :type => Boolean, :default => false
15
15
  field :is_feature, :type => Boolean, :default => false
16
-
16
+
17
17
  field :weight, :type => Integer, :default => 10
18
18
 
19
19
  has_many :children_tags, :class_name => 'Tag', :inverse_of => :parent_tag
@@ -47,7 +47,7 @@ class Tag
47
47
  Tag.each { |r| r.remove }
48
48
  end
49
49
  end
50
-
50
+
51
51
  def self.no_parent
52
52
  Tag.where( :parent_tag_id => nil )
53
53
  end
@@ -71,10 +71,10 @@ class Tag
71
71
  def self.n_videos
72
72
  4
73
73
  end
74
-
74
+
75
75
  # @deprecated I don't even know why I have this. Should be simplified into non-being.
76
76
  def self.n_features
77
77
  4
78
78
  end
79
-
79
+
80
80
  end
data/lib/venue.rb CHANGED
@@ -43,6 +43,8 @@ class Venue
43
43
  embeds_many :newsitems
44
44
  embeds_many :features
45
45
 
46
+ PER_PAGE = 6
47
+
46
48
  def self.list conditions = { :is_trash => false }
47
49
  out = self.where( conditions).order_by( :name => :asc )
48
50
  [['', nil]] + out.map { |item| [ item.name, item.id ] }
data/lib/video.rb CHANGED
@@ -25,7 +25,7 @@ class Video
25
25
  has_and_belongs_to_many :tags
26
26
  belongs_to :city, :optional => true
27
27
  belongs_to :site, :optional => true
28
- has_many :newsitems
28
+ # has_many :newsitems # unnecessary, right? _vp_ 20200412
29
29
 
30
30
  belongs_to :user_profile, :optional => true, :class_name => 'IshModels::UserProfile', :inverse_of => :videos
31
31
 
@@ -56,7 +56,7 @@ class Video
56
56
  :validate_media_type => false
57
57
  validates_attachment_content_type :video, content_type: /\Avideo\/.*\Z/
58
58
 
59
- has_mongoid_attached_file :thumb,
59
+ has_mongoid_attached_file :thumb,
60
60
  :styles => {
61
61
  :mini => '20x20#',
62
62
  :thumb => "100x100#",
@@ -72,7 +72,7 @@ class Video
72
72
  :s3_protocol => 'https',
73
73
  :validate_media_type => false
74
74
  validates_attachment_content_type :thumb, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif", 'application/octet-stream' ]
75
-
75
+
76
76
  set_callback :update, :after do |doc|
77
77
  Site.update_all updated_at: Time.now
78
78
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33.118
4
+ version: 0.0.33.123
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2017-05-10 00:00:00.000000000 Z
@@ -114,7 +114,7 @@ files:
114
114
  - lib/event.rb
115
115
  - lib/feature.rb
116
116
  - lib/gallery.rb
117
- - lib/gallery2.rb
117
+ - lib/gallery2.rb-trash
118
118
  - lib/gameui.rb
119
119
  - lib/gameui/map.rb
120
120
  - lib/gameui/marker.rb
@@ -154,7 +154,7 @@ homepage: http://wasya.co
154
154
  licenses:
155
155
  - MIT
156
156
  metadata: {}
157
- post_install_message:
157
+ post_install_message:
158
158
  rdoc_options: []
159
159
  require_paths:
160
160
  - lib
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  version: '0'
171
171
  requirements: []
172
172
  rubygems_version: 3.0.6
173
- signing_key:
173
+ signing_key:
174
174
  specification_version: 4
175
175
  summary: models of ish
176
176
  test_files: []