ish_models 0.0.33.44 → 0.0.33.45

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
  SHA1:
3
- metadata.gz: ae8cc06d720e0f74c54c5cb023e44987508750c5
4
- data.tar.gz: e6563778373e88fbaf74abc432b8aed2a06ee52e
3
+ metadata.gz: 06f15ccc72f9b4e6ed3428fc99ecd8fb1ffc7a37
4
+ data.tar.gz: 1cea75cb5c4da728f9bc8071c0ea81ffe17a2058
5
5
  SHA512:
6
- metadata.gz: 6f299c95e12134ca60f73284f2f0015b43b8b0583c4b082bf48d614cab1359abae990f2530fe72f6cb3a4e9ea7b69716808180ea7161b2b4fb03e3fd51b1c43f
7
- data.tar.gz: 373095ba9a5d6b516d685670bdcb1922081817a6aaa16318f0f8d2321ad88c57b915dcd3f39aed76af8b986a2d0ef6369c16a19b636b896edbf6864ecd9dd230
6
+ metadata.gz: e9787652dc225601799fa42a4ec5799836a9c1ca7411330f8e95c29afccfa164622ab8716cef213a0fc33149da50beedf992443b7e53032706acc8e0fab39950
7
+ data.tar.gz: 3388f85671b2506b5121778e6d8be61eb2f6fc94fb6e4ee5974cc665dcf7bafc8849db3a23af5cff633d300753a4b9db29ec2d58566f47f97f0eaace5c738824
@@ -2,8 +2,9 @@ class IshModels::UserProfile
2
2
  include Mongoid::Document
3
3
  include Mongoid::Timestamps
4
4
 
5
- field :username, :type => String
5
+ # field :username, :type => String
6
6
  field :name
7
+ validates_presence_of :name
7
8
 
8
9
  field :email
9
10
  # validates_format_of :email, :with => ::Devise::email_regexp
data/lib/report.rb CHANGED
@@ -92,6 +92,11 @@ class Report
92
92
  end
93
93
  end
94
94
 
95
+ before_validation :set_name_seo, :on => :create
96
+ def set_name_seo
97
+ self.name_seo ||= self.name.gsub(' ', '-').gsub('.', '')
98
+ end
99
+
95
100
  set_callback :create, :after do |doc|
96
101
  if doc.is_public
97
102
 
data/lib/tag.rb CHANGED
@@ -34,7 +34,7 @@ class Tag
34
34
 
35
35
  before_create do |d|
36
36
  if d.name_seo.blank?
37
- d.name_seo = d.name.to_simple_string
37
+ d.name_seo = d.name.gsub(' ', '-')
38
38
  end
39
39
  end
40
40
 
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.44
4
+ version: 0.0.33.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox