ish_models 3.0.0.1 → 3.1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +28 -0
  4. data/Rakefile +15 -0
  5. data/app/assets/config/ish_models_manifest.js +1 -0
  6. data/app/assets/stylesheets/ish_models/application.css +15 -0
  7. data/app/controllers/ish_models/application_controller.rb +4 -0
  8. data/app/helpers/ish_models/application_helper.rb +4 -0
  9. data/app/jobs/ish_models/application_job.rb +4 -0
  10. data/app/mailers/ish_models/application_mailer.rb +6 -0
  11. data/app/models/ish_models/application_record.rb +5 -0
  12. data/app/views/layouts/ish_models/application.html.erb +15 -0
  13. data/config/routes.rb +2 -0
  14. data/lib/ish_models/engine.rb +5 -0
  15. data/lib/ish_models/version.rb +3 -0
  16. data/lib/ish_models.rb +4 -94
  17. data/lib/tasks/ish_models_tasks.rake +4 -0
  18. data/lib/{office/admin_message.rb → wco/profile.rb} +2 -5
  19. metadata +32 -225
  20. data/lib/address.rb +0 -20
  21. data/lib/feature.rb +0 -32
  22. data/lib/gallery.rb +0 -66
  23. data/lib/gameui/asset3d.rb +0 -33
  24. data/lib/gameui/map.rb +0 -260
  25. data/lib/gameui/map_bookmark.rb +0 -9
  26. data/lib/gameui/marker.rb +0 -128
  27. data/lib/iro/option_watch.rb +0 -72
  28. data/lib/ish/cache_key.rb +0 -14
  29. data/lib/ish/configuration.rb +0 -11
  30. data/lib/ish/crawler.rb +0 -26
  31. data/lib/ish/email_campaign.rb +0 -55
  32. data/lib/ish/email_context.rb +0 -113
  33. data/lib/ish/email_template.rb +0 -115
  34. data/lib/ish/email_unsubscribe.rb +0 -19
  35. data/lib/ish/event.rb +0 -20
  36. data/lib/ish/image_asset.rb +0 -38
  37. data/lib/ish/invoice.rb +0 -130
  38. data/lib/ish/lorem_ipsum.rb +0 -30
  39. data/lib/ish/meeting.rb +0 -31
  40. data/lib/ish/payment.rb +0 -29
  41. data/lib/ish/premium_item.rb +0 -13
  42. data/lib/ish/railtie.rb +0 -8
  43. data/lib/ish/user_profile.rb +0 -149
  44. data/lib/ish/utils.rb +0 -45
  45. data/lib/mongoid/votable.rb +0 -247
  46. data/lib/mongoid/voter.rb +0 -96
  47. data/lib/newsitem.rb +0 -94
  48. data/lib/office/action.rb +0 -32
  49. data/lib/office/action_tie.rb +0 -16
  50. data/lib/office/directmail_envelope.rb +0 -51
  51. data/lib/office/email_action.rb +0 -34
  52. data/lib/office/email_action_tie.rb +0 -18
  53. data/lib/office/email_attachment.rb +0 -12
  54. data/lib/office/email_conversation.rb +0 -102
  55. data/lib/office/email_conversation_lead.rb +0 -11
  56. data/lib/office/email_conversation_tag.rb +0 -14
  57. data/lib/office/email_filter.rb +0 -45
  58. data/lib/office/email_message.rb +0 -192
  59. data/lib/office/email_message_stub.rb +0 -22
  60. data/lib/office/emailtag.rb +0 -27
  61. data/lib/office/emailtag_email_conversation.rb +0 -10
  62. data/lib/office/lead_action.rb +0 -24
  63. data/lib/office/lead_action_template.rb +0 -47
  64. data/lib/office/obfuscated_redirect.rb +0 -12
  65. data/lib/office/scheduled_email_action.rb +0 -62
  66. data/lib/photo.rb +0 -87
  67. data/lib/report.rb +0 -65
  68. data/lib/video.rb +0 -91
  69. data/lib/wco/appliance.rb +0 -52
  70. data/lib/wco/appliance_tmpl.rb +0 -56
  71. data/lib/wco/dns_domain.rb +0 -23
  72. data/lib/wco/email_conversation_lead.rb +0 -10
  73. data/lib/wco/leadset.rb +0 -26
  74. data/lib/wco/price.rb +0 -30
  75. data/lib/wco/product.rb +0 -35
  76. data/lib/wco/serverhost.rb +0 -140
  77. data/lib/wco/subscription.rb +0 -25
@@ -1,113 +0,0 @@
1
- ##
2
- ## Send a single email
3
- ##
4
-
5
- class ::Ish::EmailContext
6
- include Mongoid::Document
7
- include Mongoid::Timestamps
8
-
9
- field :slug
10
- validates_uniqueness_of :slug, allow_nil: true
11
-
12
- field :preview_str, type: :string
13
- def preview_str
14
- if self[:preview_str].presence
15
- return self[:preview_str]
16
- else
17
- return tmpl.preview_str
18
- end
19
- end
20
-
21
- field :body
22
- def body
23
- if self[:body].presence
24
- return self[:body]
25
- else
26
- return tmpl.body
27
- end
28
- end
29
-
30
- PAGE_PARAM_NAME = 'email_contexts_page'
31
-
32
- field :from_email
33
- def from_email
34
- if self[:from_email].presence
35
- return self[:from_email]
36
- else
37
- return tmpl.from_email
38
- end
39
- end
40
-
41
- field :subject
42
- def subject
43
- self[:subject].presence || tmpl.subject
44
- end
45
-
46
- belongs_to :email_template
47
- def tmpl; email_template; end
48
-
49
- belongs_to :scheduled_email_action, class_name: '::Office::ScheduledEmailAction', optional: true
50
- def sch; scheduled_email_action; end
51
-
52
- belongs_to :email_campaign, class_name: 'Ish::EmailCampaign', optional: true
53
-
54
- field :rendered_str
55
-
56
- field :sent_at, type: DateTime
57
- field :send_at, type: DateTime
58
- field :unsubscribed_at, type: DateTime
59
-
60
-
61
- def notsent
62
- Ish::EmailContext.where( sent_at: nil, unsubscribed_at: nil )
63
- end
64
- def self.notsent; new.notsent; end
65
-
66
-
67
- def scheduled
68
- # or({ :send_at.lte => Time.now }, { :send_at => nil }) ## This won't work b/c I need draft state!
69
- Ish::EmailContext.where({ :send_at.lte => Time.now })
70
- end
71
- def self.scheduled; new.scheduled; end
72
-
73
-
74
- ## like belongs_to to_lead , but Lead is SQL to just the lead_id
75
- field :lead_id, type: :integer
76
- def lead; Lead.find( lead_id ); end
77
- def to_email; lead[:email]; end ## @TODO: remove, just use the lead. _vp_ 2023-03-27
78
- # ## no `to` field b/c that's the lead
79
- # field :tos, type: :array, default: []
80
- field :cc, type: :string
81
- field :ccs, type: :array, default: []
82
-
83
- ##
84
- ## For tracking / utm
85
- ##
86
- attr_reader :tid
87
-
88
- def get_binding
89
- @lead = lead()
90
- @utm_tracking_str = {
91
- 'cid' => lead.id,
92
- 'utm_campaign' => tmpl.slug,
93
- 'utm_medium' => 'email',
94
- 'utm_source' => tmpl.slug,
95
- }.map { |k, v| "#{k}=#{v}" }.join("&")
96
- eval( tmpl.config_exe )
97
- binding()
98
- end
99
-
100
- def self.summary
101
- pipeline = [
102
- { '$group' => {
103
- '_id' => { '$dateToString' => { 'format' => "%Y-%m-%d", 'date' => "$sent_at", 'timezone' => 'America/Chicago' } }, 'total' => { '$sum' => 1 }
104
- } },
105
- { '$sort' => { '_id': -1 } },
106
- ]
107
- outs = Ish::EmailContext.collection.aggregate( pipeline )
108
- outs.to_a
109
- end
110
-
111
- end
112
- Ctx = ::Ish::EmailContext
113
-
@@ -1,115 +0,0 @@
1
-
2
- class ::Ish::EmailTemplate
3
- include Mongoid::Document
4
- include Mongoid::Timestamps
5
-
6
- field :slug
7
- validates_uniqueness_of :slug
8
- validates_presence_of :slug
9
-
10
- field :preview_str, type: :string
11
-
12
- field :layout, type: :string, default: 'plain'
13
- LAYOUTS = %w| plain
14
- m20221201react m20221222merryxmas
15
- m202309_feedback
16
- m202309_ror4
17
- marketing_node_1
18
- marketing_react_1 marketing_react_2 marketing_react_3
19
- marketing_ror_1 marketing_ror_2
20
- marketing_wordpres_1 marketing_wordpress_2
21
- piousbox_roundborders
22
- plain
23
- tracking_footer
24
- wasyaco_roundborders |
25
-
26
- field :subject
27
- field :body
28
- field :can_unsubscribe, type: :boolean, default: true
29
- field :config_exe, default: "" ## unused! _vp_ 2023-09-24
30
- field :config_json, type: Object, default: '{}'
31
-
32
- DEFAULT_FROM_EMAIL = 'Victor Pudeyev <victor@wasya.co>'
33
- FROM_EMAILS = [
34
- 'Annesque Studio <hello@annesque.studio>',
35
- 'Annesque Studio <no-reply@annesque.studio>',
36
-
37
- 'BJJCollective <hello@bjjcollective.com>',
38
- 'BJJCollective <no-reply@bjjcollective.com>',
39
-
40
- 'DemmiTV <hello@demmi.tv>',
41
- 'DemmiTV <no-reply@demmi.tv>',
42
-
43
- 'Victor Pudeyev <victor@fedfis.com>',
44
-
45
- 'Infinite Shelter <hello@infiniteshelter.com>',
46
- 'Infinite Shelter <no-reply@infiniteshelter.com>',
47
-
48
- 'Oquaney Splicing <hello@oquaney-splicing.com>',
49
- 'Oquaney Splicing <no-reply@oquaney-splicing.com>',
50
-
51
- 'Victor Pudeyev <piousbox@gmail.com>',
52
- 'Victor Pudeyev <victor@piousbox.com>',
53
- 'Victor Pudeyev <no-reply@piousbox.com>',
54
- 'Victor Pudeyev <victor@pudeyev.com>',
55
-
56
- 'Sender SBS <hello@sender.sbs>',
57
- 'Sender SBS <no-reply@sender.sbs>',
58
-
59
- 'WasyaCo Consulting <admin@wasya.co>',
60
- 'Alex WCo <alex@wasya.co>',
61
- 'Bailey WCo <bailey@wasya.co>',
62
- 'Cameron WCo <cameron@wasya.co>',
63
- 'WasyaCo Consulting <hello@wasya.co>',
64
- 'Jess WCo <jess@wasya.co>',
65
- 'WasyaCo Consulting <no-reply@wasya.co>',
66
- 'Victor Pudeyev <victor@wasya.co>',
67
-
68
- 'WasyaCo Consulting <admin@wasyaco.com>',
69
- 'Alex WCo <alex@wasyaco.com>',
70
- 'Bailey WCo <bailey@wasyaco.com>',
71
- 'Cameron WCo <cameron@wasyaco.com>',
72
- 'WasyaCo Consulting <hello@wasyaco.com>',
73
- 'WasyaCo Consulting <no-reply@wasyaco.com>',
74
- 'Victor Pudeyev <victor@wasyaco.com>',
75
-
76
- 'Wasya Co Mailer <no-reply@wco.com.de>',
77
- 'Wasya Co Mailer <wasyacomailer@gmail.com>',
78
- ];
79
- field :from_email
80
- def self.from_email_list
81
- [ [nil, nil] ] + FROM_EMAILS.map { |i| [i, i] }
82
- end
83
-
84
- SIGNATURE = <<~AOL
85
- <div>
86
- <div><br></div>
87
- <div>Regards,</div>
88
- <div>-=----- &gt;8 --</div>
89
- <div>Victor Pudeyev<br>Director of Engineering<br><a href="mailto:victor@wasya.co" target="_blank">victor@wasya.co</a> | <a href="https://tidycal.com/wasya-co/30min" target="_blank">Book a chat</a><br></div>
90
- </div><hr /><br /><br /><br />
91
- AOL
92
-
93
- ## 2023-03-04 _vp_ This works!
94
- def get_binding
95
- @lead = Lead.where( email: 'stub@wasya.co' ).first
96
- binding()
97
- end
98
-
99
- has_many :email_actions, class_name: '::Office::EmailAction'
100
- has_many :email_contexts, class_name: '::Ish::EmailContext'
101
- has_many :email_filters, class_name: '::Office::EmailFilter', inverse_of: :email_template
102
- has_many :unsubscribes, class_name: '::Ish::EmailUnsubscribe', inverse_of: :template
103
-
104
- SLUG_BLANK = 'blank'
105
- def self.blank_template
106
- out = Tmpl.find_or_create_by({ slug: SLUG_BLANK })
107
- end
108
- def self.blank; self.blank_template; end
109
-
110
- def to_s
111
- "Tmpl:#{slug}"
112
- end
113
-
114
- end
115
- ::Tmpl = ::Ish::EmailTemplate
@@ -1,19 +0,0 @@
1
-
2
- class Ish::EmailUnsubscribe
3
- include Mongoid::Document
4
- include Mongoid::Timestamps
5
-
6
- field :email
7
- # validates_presence_of :email
8
- # validates_uniqueness_of :email
9
-
10
- field :lead_id, type: :integer
11
- field :reason
12
- field :unsubscribed_at
13
-
14
- belongs_to :campaign, class_name: '::Ish::EmailCampaign', inverse_of: :unsubscribes, optional: true
15
- belongs_to :template, class_name: '::Ish::EmailTemplate', inverse_of: :unsubscribes, optional: true
16
-
17
-
18
- end
19
-
data/lib/ish/event.rb DELETED
@@ -1,20 +0,0 @@
1
-
2
- class Ish::Event
3
- include Mongoid::Document
4
- include Mongoid::Timestamps
5
-
6
- field :start_at, type: ActiveSupport::TimeWithZone
7
- index({ start_at: 1 })
8
-
9
- field :end_at, type: ActiveSupport::TimeWithZone
10
-
11
- field :name
12
- index({ name: 1 })
13
-
14
- field :descr
15
-
16
- field :is_public, type: :boolean, default: false
17
- index({ is_public: 1 })
18
-
19
- end
20
-
@@ -1,38 +0,0 @@
1
-
2
- # require 'aws-sdk'
3
- require 'mongoid_paperclip'
4
-
5
- class Ish::ImageAsset
6
- include Mongoid::Document
7
- include Mongoid::Timestamps
8
- include Mongoid::Paperclip
9
- include Ish::Utils
10
-
11
- belongs_to :location, class_name: 'Gameui::Map', inverse_of: :image, optional: true
12
- belongs_to :marker, class_name: 'Gameui::Marker', inverse_of: :image, optional: true
13
- belongs_to :marker_title, class_name: 'Gameui::Marker', inverse_of: :title_image, optional: true
14
-
15
- has_mongoid_attached_file :image,
16
- :styles => {
17
- :thumb => "100x100#",
18
- },
19
- :storage => :s3,
20
- :s3_credentials => ::S3_CREDENTIALS,
21
- :path => "image_assets/:style/:id/:filename",
22
- :s3_protocol => 'https',
23
- :validate_media_type => false,
24
- s3_region: ::S3_CREDENTIALS[:region]
25
-
26
- validates_attachment_content_type :image, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif", 'application/octet-stream' ]
27
-
28
- def export_fields
29
- %w|
30
- location_id
31
- marker_id marker_title_id
32
- image_file_name image_content_type image_file_size image_updated_at image_fingerprint
33
- |
34
- end
35
-
36
- end
37
-
38
- Asset = Ish::ImageAsset
data/lib/ish/invoice.rb DELETED
@@ -1,130 +0,0 @@
1
- require 'autoinc'
2
- require 'prawn'
3
- require 'prawn/table'
4
-
5
- ##
6
- ## Invoice - for wasya.co
7
- ## 2017-10-31 _vp_ Start
8
- ## 2023-08-18 _vp_ Continue
9
- ##
10
- class Ish::Invoice
11
- include Mongoid::Document
12
- include Mongoid::Timestamps
13
- include Mongoid::Autoinc
14
-
15
- store_in collection: 'ish_invoice'
16
-
17
- field :email, type: String
18
-
19
- field :invoice_id, type: String # stripe
20
-
21
- field :leadset_id, type: Integer
22
- def leadset
23
- Leadset.find leadset_id
24
- end
25
-
26
- field :number, type: Integer
27
-
28
- field :month_on, type: Date
29
-
30
- has_one :asset, class_name: '::Gameui::Asset3d' ## the pdf
31
-
32
- def filename
33
- "invoice-#{number}.pdf"
34
- end
35
-
36
- # field :amount_cents, type: Integer
37
-
38
- field :description, type: String
39
- field :items, type: Array # used by stripe
40
-
41
-
42
-
43
- ## Prawn/pdf unit of measure is 1/72"
44
- ## Canvas width: 612, height: 792
45
- ##
46
- ## tree image: 896 x 1159
47
- ## tree image: 791 x 1024
48
- ## tree image: 964 x 1248
49
- ##
50
- def generate_monthly_invoice
51
- tree_img_url = "#{Rails.root.join('public')}/tree-#{number}.jpg"
52
- wasya_co_logo_url = "#{Rails.root.join('public')}/259x66-WasyaCo-logo.png"
53
-
54
- ## canvas width: 612, height: 792
55
- pdf = Prawn::Document.new
56
-
57
- pdf.canvas do
58
- pdf.image tree_img_url, at: [ 0, 792 ], width: 612
59
-
60
- pdf.fill_color 'ffffff'
61
- pdf.transparent( 0.75 ) do
62
- pdf.fill_rectangle [0, 792], 612, 792
63
- end
64
- pdf.fill_color '000000'
65
-
66
- pdf.image wasya_co_logo_url, at: [252, 720], width: 108 ## 1.5"
67
-
68
- pdf.bounding_box( [0.75*72, 9.25*72], width: 3.25*72, height: 0.75*72 ) do
69
- pdf.text "From:"
70
- pdf.text "Wasya Co"
71
- pdf.text "victor@wasya.co"
72
- end
73
-
74
- pdf.bounding_box( [4.5*72, 9.25*72], width: 3.25*72, height: 0.75*72 ) do
75
- pdf.text "Stats:"
76
- pdf.text "Date: #{ Time.now.to_date.to_s }"
77
- pdf.text "Invoice #: #{ number }"
78
- end
79
-
80
- pdf.bounding_box( [0.75*72, 8.25*72], width: 3.25*72, height: 0.75*72 ) do
81
- pdf.text "To:"
82
- pdf.text leadset.name
83
- pdf.text leadset.email
84
- end
85
-
86
- pdf.bounding_box( [4.5*72, 8.25*72], width: 3.25*72, height: 0.75*72 ) do
87
- pdf.text "Notes:"
88
- pdf.text "Support & various tasks, for the month of #{ month_on.strftime('%B') }."
89
- end
90
-
91
- lineitems_with_header = [
92
- [ 'Description', 'Per Unit', '# of Units', 'Subtotal' ]
93
- ]
94
- total = 0
95
- leadset.subscriptions.each do |i|
96
- subtotal = (i.price.amount_cents * i.quantity).to_f/100
97
- lineitems_with_header.push([ i.price.product.name, i.price.name_simple, i.quantity, subtotal ])
98
- total += subtotal
99
- end
100
-
101
-
102
- pdf.move_down 20
103
- pdf.table(lineitems_with_header, {
104
- position: :center,
105
- width: 7.5*72,
106
- cell_style: {
107
- inline_format: true,
108
- borders: [ :bottom ]
109
- },
110
- } )
111
-
112
- pdf.table([
113
- [ 'Total' ],
114
- [ total ],
115
- ], {
116
- position: 7*72,
117
- width: 1*72,
118
- cell_style: {
119
- inline_format: true,
120
- borders: [ :bottom ]
121
- },
122
- } )
123
-
124
- pdf.text_box "Thank you!", at: [ 3.25*72, 1.25*72 ], width: 2*72, height: 1*72, align: :center
125
- end
126
-
127
- return pdf
128
- end
129
-
130
- end
@@ -1,30 +0,0 @@
1
-
2
- class Ish::LoremIpsum
3
-
4
- ARR = [
5
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas a diam pretium, pellentesque lorem consequat, tempus lorem. Morbi et augue mattis, mollis enim et, lobortis ipsum. Aenean ultrices efficitur convallis. Aliquam vel tellus eu orci lobortis rhoncus. Proin varius tellus id pellentesque imperdiet. Donec accumsan diam ut tortor hendrerit pharetra. Duis rhoncus sapien leo, nec tempor massa luctus nec. In venenatis, augue ac pharetra malesuada, erat elit aliquam nisi, ac rutrum nunc purus in odio. Nam mattis vehicula finibus. Vivamus porta, massa nec posuere pulvinar, lacus nisl varius tortor, non fermentum ligula sem at odio. Cras viverra ligula quis elementum gravida. Integer interdum, orci quis varius viverra, neque eros tincidunt ex, quis fringilla quam erat in ex.",
6
- "Pellentesque consectetur faucibus porta. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque ut orci ut justo rutrum mattis non non turpis. Quisque velit neque, porttitor at lacus quis, ultricies aliquam orci. Morbi finibus neque dolor, vitae convallis leo aliquam in. Nullam posuere urna quis velit mattis, vitae posuere mi elementum. Cras vitae fermentum nisi, sed pretium diam. Donec vestibulum, leo et vehicula pharetra, massa ante vestibulum risus, malesuada pretium metus ipsum eget quam. Nunc feugiat enim elit. Mauris dictum arcu ac nisl placerat, eu cursus tellus malesuada.",
7
- "Nullam ultrices neque ut ipsum venenatis, et luctus justo aliquet. Nam laoreet magna eget accumsan ultrices. Quisque ut congue velit. Vivamus tincidunt bibendum tincidunt. Cras at purus eget odio consequat porta. Nullam ultricies dolor non dignissim commodo. Nullam cursus est eu mauris pharetra, sed euismod risus bibendum. Nullam quis luctus ante.",
8
- "Suspendisse cursus quis tellus a dictum. Proin tempus metus nec ultrices egestas. Phasellus imperdiet in ante et bibendum. In aliquam nec sapien vel rutrum. Nunc libero velit, bibendum ac dolor non, interdum fringilla nulla. Aliquam nec lectus nibh. Curabitur non scelerisque tellus, eu viverra ligula. Maecenas euismod sem turpis, ac efficitur velit placerat eget.",
9
- "Donec faucibus urna a mauris vulputate, quis dignissim turpis venenatis. Phasellus sodales dignissim molestie. Donec ultrices tempor aliquam. Pellentesque sed mi volutpat, euismod erat quis, ultricies enim. Curabitur in nibh eget ipsum fringilla laoreet. Vivamus tincidunt rutrum ullamcorper. Nulla suscipit, libero sit amet blandit venenatis, lorem diam viverra elit, sed egestas elit eros at libero.",
10
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas a diam pretium, pellentesque lorem consequat, tempus lorem. Morbi et augue mattis, mollis enim et, lobortis ipsum. Aenean ultrices efficitur convallis. Aliquam vel tellus eu orci lobortis rhoncus. Proin varius tellus id pellentesque imperdiet. Donec accumsan diam ut tortor hendrerit pharetra. Duis rhoncus sapien leo, nec tempor massa luctus nec. In venenatis, augue ac pharetra malesuada, erat elit aliquam nisi, ac rutrum nunc purus in odio. Nam mattis vehicula finibus. Vivamus porta, massa nec posuere pulvinar, lacus nisl varius tortor, non fermentum ligula sem at odio. Cras viverra ligula quis elementum gravida. Integer interdum, orci quis varius viverra, neque eros tincidunt ex, quis fringilla quam erat in ex.",
11
- "Pellentesque consectetur faucibus porta. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque ut orci ut justo rutrum mattis non non turpis. Quisque velit neque, porttitor at lacus quis, ultricies aliquam orci. Morbi finibus neque dolor, vitae convallis leo aliquam in. Nullam posuere urna quis velit mattis, vitae posuere mi elementum. Cras vitae fermentum nisi, sed pretium diam. Donec vestibulum, leo et vehicula pharetra, massa ante vestibulum risus, malesuada pretium metus ipsum eget quam. Nunc feugiat enim elit. Mauris dictum arcu ac nisl placerat, eu cursus tellus malesuada.",
12
- "Nullam ultrices neque ut ipsum venenatis, et luctus justo aliquet. Nam laoreet magna eget accumsan ultrices. Quisque ut congue velit. Vivamus tincidunt bibendum tincidunt. Cras at purus eget odio consequat porta. Nullam ultricies dolor non dignissim commodo. Nullam cursus est eu mauris pharetra, sed euismod risus bibendum. Nullam quis luctus ante.",
13
- "Suspendisse cursus quis tellus a dictum. Proin tempus metus nec ultrices egestas. Phasellus imperdiet in ante et bibendum. In aliquam nec sapien vel rutrum. Nunc libero velit, bibendum ac dolor non, interdum fringilla nulla. Aliquam nec lectus nibh. Curabitur non scelerisque tellus, eu viverra ligula. Maecenas euismod sem turpis, ac efficitur velit placerat eget.",
14
- "Donec faucibus urna a mauris vulputate, quis dignissim turpis venenatis. Phasellus sodales dignissim molestie. Donec ultrices tempor aliquam. Pellentesque sed mi volutpat, euismod erat quis, ultricies enim. Curabitur in nibh eget ipsum fringilla laoreet. Vivamus tincidunt rutrum ullamcorper. Nulla suscipit, libero sit amet blandit venenatis, lorem diam viverra elit, sed egestas elit eros at libero.",
15
- ]
16
-
17
-
18
- def self.txt n=3
19
- ARR[0...3].join("\n\n")
20
- end
21
-
22
- private
23
-
24
- def self.html n=3
25
- "<p>#{ARR[0...n].join("</p><p>")}</p>"
26
- end
27
-
28
-
29
- end
30
-
data/lib/ish/meeting.rb DELETED
@@ -1,31 +0,0 @@
1
-
2
- class Ish::Meeting
3
- include Mongoid::Document
4
- include Mongoid::Timestamps
5
-
6
- field :datetime, type: DateTime
7
- field :invitee_email, type: String
8
- field :invitee_name, type: String
9
- field :timezone, type: String, default: 'Central Time (US & Canada)'
10
- field :template_name
11
-
12
- field :send_reminder_morning, type: Boolean, default: false
13
- field :send_reminder_15min, type: Boolean, default: false
14
-
15
- def self.template_name_options
16
- [
17
- [ '', '' ],
18
- ['calendly_meeting_v1', 'calendly_meeting_v1'],
19
- ['calendly_meeting_v2', 'calendly_meeting_v2'],
20
- ]
21
- end
22
-
23
- def host_name
24
- 'Victor Puudeyev'
25
- end
26
-
27
- def host_email
28
- 'piousbox@gmail.com'
29
- end
30
-
31
- end
data/lib/ish/payment.rb DELETED
@@ -1,29 +0,0 @@
1
-
2
- class Ish::Payment
3
- include Mongoid::Document
4
- include Mongoid::Timestamps
5
-
6
- belongs_to :invoice, class_name: 'Ish::Invoice', optional: true
7
- belongs_to :profile, class_name: 'Ish::UserProfile'
8
- belongs_to :item, polymorphic: true
9
-
10
- field :amount, :type => Integer # in cents
11
- field :charge, :type => Hash
12
- field :email, :type => String
13
-
14
- field :client_secret
15
- field :payment_intent_id
16
-
17
- STATUS_CONFIRMED = 'confirmed'
18
- STATUS_PENDING = 'pending'
19
- STATUSES = %w| active pending |
20
- field :status, type: Symbol, default: STATUS_PENDING
21
- scope :confirmed, ->{ where( status: STATUS_CONFIRMED ) }
22
-
23
- after_create :compute_paid_invoice_amount
24
- def compute_paid_invoice_amount
25
- self.invoice&.update_attributes({ paid_amount: self.invoice.paid_amount + self.amount })
26
- end
27
-
28
- end
29
-
@@ -1,13 +0,0 @@
1
-
2
- module Ish::PremiumItem
3
-
4
- def self.included base
5
- base.send :field, :premium_tier, type: Integer, default: 0 # how many unlocks are need, to get access? 0 = free
6
- base.send :has_many, :premium_purchases, class_name: '::Ish::Payment', as: :item
7
- end
8
-
9
- def is_premium
10
- premium_tier > 0
11
- end
12
-
13
- end
data/lib/ish/railtie.rb DELETED
@@ -1,8 +0,0 @@
1
- require 'rails'
2
-
3
- module Ish
4
- class Railtie < Rails::Railtie
5
- initializer "ish_models.configure" do |app|
6
- end
7
- end
8
- end