phcmemberspro 11.11.5 → 12.0.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b1dbfe04398c21f2e243a684478fde495fc8f27
|
4
|
+
data.tar.gz: 528731949052c57ebcb39ca6d5e0c19cc9346338
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0028a044f03a4c929c8e94167e02c61f7eaaadc04e263c35a956c7e316663fc8489368db79ac580d92799ec3f67ce352d05d36111d0e94fba8081a8dd97d9d49
|
7
|
+
data.tar.gz: 5275df1d7cc119047d21f7e4e0c0df6319fd11f240800c61f71e40daf2db97ddfb749114ff7cb997e53fb18b57632ee7f829bc263937c4c62d3dd7f82246a088
|
@@ -5,7 +5,7 @@ module Phcmemberspro
|
|
5
5
|
before_action :require_user
|
6
6
|
protect_from_forgery with: :exception
|
7
7
|
|
8
|
-
# Papertrail
|
8
|
+
# Papertrail Whodunnit Username
|
9
9
|
def user_for_paper_trail
|
10
10
|
# Default is: current_user rescue nil
|
11
11
|
current_user ? current_user.username : 'Public user'
|
@@ -7,5 +7,33 @@ module Phcmemberspro
|
|
7
7
|
# Model Relationships
|
8
8
|
belongs_to :profile, class_name: 'Phcmemberspro::Member::Profile'
|
9
9
|
|
10
|
+
# Validation for Form Fields
|
11
|
+
validates :mcaddressl1,
|
12
|
+
presence: true,
|
13
|
+
length: { minimum: 2 }
|
14
|
+
|
15
|
+
validates :mcaddressl2,
|
16
|
+
presence: true,
|
17
|
+
length: { minimum: 2 }
|
18
|
+
|
19
|
+
validates :mccity,
|
20
|
+
length: { minimum: 3 }
|
21
|
+
|
22
|
+
validates :mcprovince,
|
23
|
+
presence: true,
|
24
|
+
length: { minimum: 3 }
|
25
|
+
|
26
|
+
validates :mccountry,
|
27
|
+
presence: true,
|
28
|
+
length: { minimum: 3 }
|
29
|
+
|
30
|
+
validates :mcpostalcode,
|
31
|
+
presence: true,
|
32
|
+
length: { minimum: 3 }
|
33
|
+
|
34
|
+
validates :mctype,
|
35
|
+
presence: true,
|
36
|
+
length: { minimum: 2 }
|
37
|
+
|
10
38
|
end
|
11
39
|
end
|
@@ -9,5 +9,50 @@ module Phcmemberspro
|
|
9
9
|
has_many :categorylistings, class_name: 'Phcmemberspro::Directory::Categorylisting', dependent: :destroy
|
10
10
|
has_many :categories, class_name: 'Phcmemberspro::Directory::Category', :through => :categorylistings
|
11
11
|
|
12
|
+
# Validation for Form Fields
|
13
|
+
validates :mbcompanyname,
|
14
|
+
presence: true,
|
15
|
+
length: { minimum: 2 }
|
16
|
+
|
17
|
+
validates :mbcontactname,
|
18
|
+
presence: true,
|
19
|
+
length: { minimum: 2 }
|
20
|
+
|
21
|
+
validates :mbaddressl1,
|
22
|
+
length: { minimum: 3 }
|
23
|
+
|
24
|
+
validates :mbaddressl2,
|
25
|
+
presence: true,
|
26
|
+
length: { minimum: 3 }
|
27
|
+
|
28
|
+
validates :mbcity,
|
29
|
+
presence: true,
|
30
|
+
length: { minimum: 3 }
|
31
|
+
|
32
|
+
validates :mbcountry,
|
33
|
+
presence: true,
|
34
|
+
length: { minimum: 3 }
|
35
|
+
|
36
|
+
validates :mbprovince,
|
37
|
+
presence: true,
|
38
|
+
length: { minimum: 2 }
|
39
|
+
|
40
|
+
validates :mbpostalcode,
|
41
|
+
presence: true,
|
42
|
+
length: { minimum: 3 }
|
43
|
+
|
44
|
+
|
45
|
+
validates :mbcontactemail,
|
46
|
+
presence: true,
|
47
|
+
length: { minimum: 3 }
|
48
|
+
|
49
|
+
validates :mbwebsite,
|
50
|
+
presence: true,
|
51
|
+
length: { minimum: 6 }
|
52
|
+
|
53
|
+
validates :mbphone,
|
54
|
+
presence: true,
|
55
|
+
format: { with: /\A(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}\z/, message: "Please Follow this Phone Number Format: xxx-xxx-xxxx" }
|
56
|
+
|
12
57
|
end
|
13
58
|
end
|