ish_models 0.0.33.241 → 0.0.33.243

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: 272ee9358917dbef42235373fb57c5c795461ea3686b9af93109d038aa67108c
4
- data.tar.gz: 14b29f6d63f6954c5068811989e8753b952dbc6406b7b1d03b25e96cd36130f9
3
+ metadata.gz: 3cb9bfd0b2e4267bdafbdc6e0e07d9064dfcb7c5bcc4d767ccf14e12ee0f81fb
4
+ data.tar.gz: b17871e045a9983e191457ad8ec843c03ce4cb515b0846ba1c5b23457a0ade34
5
5
  SHA512:
6
- metadata.gz: 29ff547eeffbf6efb6d1954726702907b2805bacf60f0b60e0a8b6560a78c1336ee51e051de39e70f8e351e1fb1e25224d923dcbed97f2ea4bcb75f4db7547c5
7
- data.tar.gz: 48fb17551e98e47216766dbfecc47b5c0d901dddbff16399889993a5a98819e1781e3b3cdd58c361acf871c707162a7b4c4c9a4323a1ebbea0cfd998bcf6aec4
6
+ metadata.gz: f1c4d9279bc85b0c051a705e18bc0404a03880e04a69d0e73056e306f6aac13f789b8afebdb73dab6e3b5b8c6fd9fde0bf10dc4f33a5f9520784109500221ed6
7
+ data.tar.gz: 45207a395aab807bdaf12b33b277e4d342267fdd5eb7ae00672e231cc93153671fc42e68fb284300068976d3f0b557cec4dd8502918a95dec76bf540c849e198
data/lib/address.rb CHANGED
@@ -4,7 +4,9 @@ class Address
4
4
  include Mongoid::Timestamps
5
5
 
6
6
  belongs_to :profile, :class_name => '::Ish::UserProfile'
7
- validates :profile, :presence => true
7
+ # validates :profile, :presence => true
8
+
9
+ field :lead_id, type: :integer
8
10
 
9
11
  field :name
10
12
  field :address_1
data/lib/gallery.rb CHANGED
@@ -9,6 +9,8 @@ class Gallery
9
9
 
10
10
  field :name
11
11
  validates :name, :uniqueness => true
12
+ index({ :name => -1 }, { :unique => true })
13
+
12
14
  field :subhead
13
15
  field :descr, :as => :description
14
16
 
data/lib/gameui/map.rb CHANGED
@@ -35,6 +35,7 @@ class ::Gameui::Map
35
35
 
36
36
  # shareable, nonpublic
37
37
  field :is_public, type: Boolean, default: true
38
+ scope :public, ->{ where( is_public: true ) }
38
39
  has_and_belongs_to_many :shared_profiles, :class_name => 'Ish::UserProfile', :inverse_of => :shared_locations
39
40
 
40
41
  field :version, type: String, default: '0.0.0'
@@ -17,6 +17,7 @@ class ::Ish::EmailTemplate
17
17
  marketing_wordpres_1 marketing_wordpress_2
18
18
  piousbox_roundborders
19
19
  plain
20
+ tracking_footer
20
21
  wasyaco_roundborders |
21
22
 
22
23
  field :subject
@@ -23,18 +23,21 @@ class Office::EmailMessage
23
23
  field :subject
24
24
  field :part_txt
25
25
  field :part_html
26
- # attachments ?
26
+ field :preamble
27
+ field :epilogue
28
+
29
+ has_many :attachments, class_name: 'Photo'
27
30
 
28
31
  def lead
29
32
  Lead.find_by email: from
30
33
  end
31
34
 
32
- field :from, type: :string
33
- field :froms, type: Array, default: []
34
- field :to, type: :string
35
- field :tos, type: Array, default: []
36
- field :ccs, type: Array, default: []
37
- field :bccs, type: Array, default: []
35
+ field :from, type: :string
36
+ field :froms, type: Array, default: []
37
+ field :to, type: :string
38
+ field :tos, type: Array, default: []
39
+ field :ccs, type: Array, default: []
40
+ field :bccs, type: Array, default: []
38
41
 
39
42
  field :date, type: DateTime
40
43
  def received_at
data/lib/photo.rb CHANGED
@@ -8,15 +8,12 @@ class Photo
8
8
  include Mongoid::Paperclip
9
9
  include Ish::Utils
10
10
 
11
- belongs_to :user_profile, :class_name => 'Ish::UserProfile', :optional => true
12
- def user
13
- user_profile
14
- end
15
- belongs_to :user_profile, :class_name => 'Ish::UserProfile', :inverse_of => :profile_photo, :optional => true
16
-
17
- belongs_to :report, :optional => true
18
- belongs_to :gallery, :optional => true
19
- belongs_to :newsitem, :optional => true
11
+ belongs_to :user_profile, :optional => true, :class_name => 'Ish::UserProfile'
12
+ belongs_to :user_profile, :optional => true, :class_name => 'Ish::UserProfile', :inverse_of => :profile_photo
13
+ belongs_to :email_message, :optional => true, :class_name => 'Office::EmailMessage'
14
+ belongs_to :report, :optional => true
15
+ belongs_to :gallery, :optional => true
16
+ belongs_to :newsitem, :optional => true
20
17
 
21
18
  # photo.photo.to_s.split('/').last.split('?').first
22
19
  field :name, :type => String
@@ -52,6 +49,7 @@ class Photo
52
49
  :s3_protocol => 'https',
53
50
  :validate_media_type => false,
54
51
  s3_region: ::S3_CREDENTIALS[:region]
52
+ validates_attachment_content_type :photo, :content_type => ["image/webp", "image/jpg", "image/jpeg", "image/png", "image/gif", 'application/octet-stream' ]
55
53
 
56
54
  def self.n_per_manager_gallery
57
55
  25
@@ -66,7 +64,23 @@ class Photo
66
64
  |
67
65
  end
68
66
 
69
- validates_attachment_content_type :photo, :content_type => ["image/webp", "image/jpg", "image/jpeg", "image/png", "image/gif", 'application/octet-stream' ]
67
+ ## From: https://gist.github.com/WizardOfOgz/1012107?permalink_comment_id=1442486
68
+ attr_accessor :content_type, :image_data, :original_filename
69
+ def decode_base64_image
70
+ if image_data && content_type && original_filename
71
+ decoded_data = Base64.decode64(image_data)
72
+
73
+ data = StringIO.new(decoded_data)
74
+ data.class_eval do
75
+ attr_accessor :content_type, :original_filename
76
+ end
77
+
78
+ data.content_type = content_type
79
+ data.original_filename = File.basename(original_filename)
80
+
81
+ self.photo = data
82
+ end
83
+ end
70
84
 
71
85
  end
72
86
 
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.241
4
+ version: 0.0.33.243
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox