phcmemberspro 5.3.10 → 5.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/phcmemberspro/directory/category.rb +1 -6
- data/app/models/phcmemberspro/directory/catlist.rb +0 -5
- data/app/models/phcmemberspro/members/business.rb +0 -5
- data/app/models/phcmemberspro/members/contact.rb +0 -5
- data/app/models/phcmemberspro/members/main.rb +2 -7
- data/lib/phcmemberspro/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23fa8c21324ad06e4c60ff9b129dcc6bdd33919b
|
4
|
+
data.tar.gz: 57622dc94bb0b0c8f75cd99b29e59dd2492a3517
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14bdd33cbfcd89cc54f21ecc234bf42a5f193142be34f77218f701390adc9d092818cca87f1af30ae478b977a8230fd1241dc7ada5680ceecb059d33a473e409
|
7
|
+
data.tar.gz: 8c8f5f84440d7a1a42a03311ff5c4e08ba55b23c7d0ad5f580aa6ed7dc25414bf127b4aa2fe24d183280272adde7ea98b3ff266d2dfdf40be976ada27fca165f
|
@@ -1,18 +1,13 @@
|
|
1
1
|
module Phcmemberspro
|
2
2
|
class Directory::Category < ActiveRecord::Base
|
3
3
|
|
4
|
-
# Account Scope
|
5
|
-
def self.scoped_to(useraccount)
|
6
|
-
where(:user_id => current_user.id)
|
7
|
-
end
|
8
|
-
|
9
4
|
# Model Relationship
|
10
5
|
has_many :catlists, class_name: 'Directory::Catlist'
|
11
6
|
|
12
7
|
# Validation for Form Fields
|
13
8
|
validates :catname,
|
14
9
|
presence: true,
|
15
|
-
uniqueness:
|
10
|
+
uniqueness => {:scope => :user_id},
|
16
11
|
length: { minimum: 3 }
|
17
12
|
|
18
13
|
end
|
@@ -1,11 +1,6 @@
|
|
1
1
|
module Phcmemberspro
|
2
2
|
class Directory::Catlist < ActiveRecord::Base
|
3
3
|
|
4
|
-
# Account Scope
|
5
|
-
def self.scoped_to(useraccount)
|
6
|
-
where(:user_id => current_user.id)
|
7
|
-
end
|
8
|
-
|
9
4
|
# Model Relationship
|
10
5
|
belongs_to :category, class_name: 'Directory::Category'
|
11
6
|
belongs_to :business, class_name: 'Members::Business'
|
@@ -1,11 +1,6 @@
|
|
1
1
|
module Phcmemberspro
|
2
2
|
class Members::Business < ActiveRecord::Base
|
3
3
|
|
4
|
-
# Account Scope
|
5
|
-
def self.scoped_to(useraccount)
|
6
|
-
where(:user_id => current_user.id)
|
7
|
-
end
|
8
|
-
|
9
4
|
# Translate Country Code to Name
|
10
5
|
def country_name
|
11
6
|
country = ISO3166::Country[mccountry]
|
@@ -1,11 +1,6 @@
|
|
1
1
|
module Phcmemberspro
|
2
2
|
class Members::Contact < ActiveRecord::Base
|
3
3
|
|
4
|
-
# Account Scope
|
5
|
-
def self.scoped_to(useraccount)
|
6
|
-
where(:user_id => current_user.id)
|
7
|
-
end
|
8
|
-
|
9
4
|
# Translate Country Code to Name
|
10
5
|
def country_name
|
11
6
|
country = ISO3166::Country[mccountry]
|
@@ -5,11 +5,6 @@ module Phcmemberspro
|
|
5
5
|
include Gravtastic
|
6
6
|
gravtastic :memail
|
7
7
|
|
8
|
-
# Account Scope
|
9
|
-
def self.scoped_to(useraccount)
|
10
|
-
where(:user_id => current_user.id)
|
11
|
-
end
|
12
|
-
|
13
8
|
# Model Relationship
|
14
9
|
has_many :businesses, class_name: 'Members::Business', dependent: :destroy
|
15
10
|
has_many :contacts, class_name: 'Members::Contact', dependent: :destroy
|
@@ -28,12 +23,12 @@ module Phcmemberspro
|
|
28
23
|
|
29
24
|
validates :memail,
|
30
25
|
presence: true,
|
31
|
-
uniqueness:
|
26
|
+
uniqueness => {:scope => :user_id},
|
32
27
|
length: { minimum: 6 }
|
33
28
|
|
34
29
|
validates :mphone,
|
35
30
|
presence: true,
|
36
|
-
uniqueness:
|
31
|
+
uniqueness => {:scope => :user_id},
|
37
32
|
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" }
|
38
33
|
|
39
34
|
end
|