phcmemberspro 5.0.0 → 5.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/phcmemberspro/members/businesses_controller.rb +1 -1
- data/app/models/phcmemberspro/members/business.rb +42 -2
- data/app/models/phcmemberspro/members/contact.rb +0 -8
- data/app/models/phcmemberspro/members/main.rb +1 -1
- data/app/views/phcmemberspro/members/businesses/_form.html.erb +5 -0
- data/app/views/phcmemberspro/members/businesses/_formpatch.html.erb +5 -0
- data/app/views/phcmemberspro/members/contacts/_form.html.erb +1 -9
- data/app/views/phcmemberspro/members/contacts/_formpatch.html.erb +1 -9
- data/app/views/phcmemberspro/members/contacts/index.html.erb +0 -2
- data/db/migrate/20160227194651_create_phcmemberspro_members_contacts.rb +0 -2
- data/db/migrate/20160514030803_create_phcmemberspro_members_businesses.rb +1 -0
- data/lib/phcmemberspro/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06aac872b7e31bf0558bbc4571a41e8b87ff8349
|
4
|
+
data.tar.gz: f1f20865bd98b04b745ddb7d434e0da71a59cb66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12c65d10224792735f2d4d1cc2dd696a404a82efe005c2bff340f227607dc88c82439cb5065b362341074db9aa2fc525ff7116453367e57788802e75030300bf
|
7
|
+
data.tar.gz: aa87ae8eac2a9422a1cc430a05ef770e36e251e753e06a08011d45b5b12951ad35a7530d7033bf732b32602f58ef637a4bc165095e360a17fc0ad3d6d6819caa
|
@@ -74,7 +74,7 @@ module Phcmemberspro
|
|
74
74
|
|
75
75
|
# White List
|
76
76
|
def members_business_params
|
77
|
-
params.require(:members_business).permit(:mbcompanyname, :mbcontactname, :mbaddressl1, :mbaddressl2, :mbcity, :mbcountry, :mbpostalcode, :mbphone, :mbcontactemail, :main_id, :account_id)
|
77
|
+
params.require(:members_business).permit(:mbcompanyname, :mbcontactname, :mbaddressl1, :mbaddressl2, :mbcity, :mbcountry, :mbprovince, :mbpostalcode, :mbphone, :mbcontactemail, :main_id, :account_id)
|
78
78
|
end
|
79
79
|
|
80
80
|
end
|
@@ -1,4 +1,44 @@
|
|
1
1
|
module Phcmemberspro
|
2
|
-
|
3
|
-
|
2
|
+
class Members::Business < ActiveRecord::Base
|
3
|
+
|
4
|
+
# Account Scope
|
5
|
+
def self.scoped_to(account)
|
6
|
+
where(:account_id => account.id)
|
7
|
+
end
|
8
|
+
|
9
|
+
# Translate Country Code to Name
|
10
|
+
def country_name
|
11
|
+
country = ISO3166::Country[mccountry]
|
12
|
+
country.translations[I18n.locale.to_s] || country.name
|
13
|
+
end
|
14
|
+
|
15
|
+
# Model Relationships
|
16
|
+
belongs_to :main, class_name: 'Members::Main'
|
17
|
+
|
18
|
+
# Validation for Form Fields
|
19
|
+
validates :mbcompanyname,
|
20
|
+
presence: true,
|
21
|
+
length: { minimum: 3 }
|
22
|
+
|
23
|
+
validates :mbcontactname,
|
24
|
+
presence: true,
|
25
|
+
length: { minimum: 2 }
|
26
|
+
|
27
|
+
validates :mbcity,
|
28
|
+
presence: true,
|
29
|
+
length: { minimum: 3 }
|
30
|
+
|
31
|
+
validates :mbprovince,
|
32
|
+
presence: true,
|
33
|
+
length: { minimum: 2 }
|
34
|
+
|
35
|
+
validates :mbcountry,
|
36
|
+
presence: true,
|
37
|
+
length: { minimum: 2 }
|
38
|
+
|
39
|
+
validates :mbpostalcode,
|
40
|
+
presence: true,
|
41
|
+
length: { minimum: 6 }
|
42
|
+
|
43
|
+
end
|
4
44
|
end
|
@@ -16,14 +16,6 @@ module Phcmemberspro
|
|
16
16
|
belongs_to :main, class_name: 'Members::Main'
|
17
17
|
|
18
18
|
# Validation for Form Fields
|
19
|
-
validates :mccontactname,
|
20
|
-
presence: true,
|
21
|
-
length: { minimum: 3 }
|
22
|
-
|
23
|
-
validates :mccompanyname,
|
24
|
-
presence: true,
|
25
|
-
length: { minimum: 2 }
|
26
|
-
|
27
19
|
validates :mccity,
|
28
20
|
presence: true,
|
29
21
|
length: { minimum: 3 }
|
@@ -11,7 +11,7 @@ module Phcmemberspro
|
|
11
11
|
end
|
12
12
|
|
13
13
|
# Model Relationship
|
14
|
-
has_many :
|
14
|
+
has_many :businesses, class_name: 'Members::Business', dependent: :destroy
|
15
15
|
has_many :contacts, class_name: 'Members::Contact', dependent: :destroy
|
16
16
|
|
17
17
|
# Validation for Form Fields
|
@@ -28,6 +28,11 @@
|
|
28
28
|
<%= f.text_field :mbcity, class: "form-control", placeholder: "Business location: City" %>
|
29
29
|
</div>
|
30
30
|
|
31
|
+
<div class="form-group field_with_errors">
|
32
|
+
<%= f.label :mbprovince, "Province" %>
|
33
|
+
<%= f.text_field :mbprovince, class: "form-control", placeholder: "Busines Location: Province" %>
|
34
|
+
</div>
|
35
|
+
|
31
36
|
<div class="form-group field_with_errors">
|
32
37
|
<%= f.label :mbcountry, "Country" %>
|
33
38
|
<%= f.text_field :mbcountry, class: "form-control", placeholder: "Busines Location: Province" %>
|
@@ -28,6 +28,11 @@
|
|
28
28
|
<%= f.text_field :mbcity, class: "form-control", placeholder: "Business location: City" %>
|
29
29
|
</div>
|
30
30
|
|
31
|
+
<div class="form-group field_with_errors">
|
32
|
+
<%= f.label :mbprovince, "Province" %>
|
33
|
+
<%= f.text_field :mbprovince, class: "form-control", placeholder: "Busines Location: Province" %>
|
34
|
+
</div>
|
35
|
+
|
31
36
|
<div class="form-group field_with_errors">
|
32
37
|
<%= f.label :mbcountry, "Country" %>
|
33
38
|
<%= f.text_field :mbcountry, class: "form-control", placeholder: "Busines Location: Province" %>
|
@@ -2,15 +2,7 @@
|
|
2
2
|
|
3
3
|
<!-- PHC-Notifi Render Validation -->
|
4
4
|
<%= render 'phcnotifi/validations', :object => @members_contact %>
|
5
|
-
|
6
|
-
<div class="form-group field_with_errors">
|
7
|
-
<label><%= f.label :mccontactname, "Contact Name*" %></label>
|
8
|
-
<%= f.text_field :mccontactname, class: "form-control", placeholder: "Mailing Contact Name" %>
|
9
|
-
</div>
|
10
|
-
<div class="form-group field_with_errors">
|
11
|
-
<label><%= f.label :mccompanyname, "Company Name" %></label>
|
12
|
-
<%= f.text_field :mccompanyname, class: "form-control", placeholder: "Company Name", data: {autocomplete_source: Phcmemberspro::Members::Contact.order(:mccompanyname).map(&:mccompanyname)} %>
|
13
|
-
</div>
|
5
|
+
|
14
6
|
<div class="form-group field_with_errors">
|
15
7
|
<label><%= f.label :mcaddressl1, "Mailing Address Line1" %></label>
|
16
8
|
<%= f.text_field :mcaddressl1, class: "form-control", placeholder: "Mailing Street Address" %>
|
@@ -2,15 +2,7 @@
|
|
2
2
|
|
3
3
|
<!-- PHC-Notifi Render Validation -->
|
4
4
|
<%= render 'phcnotifi/validations', :object => @members_contact %>
|
5
|
-
|
6
|
-
<div class="form-group field_with_errors">
|
7
|
-
<label><%= f.label :mccontactname, "Contact Name*" %></label>
|
8
|
-
<%= f.text_field :mccontactname, class: "form-control", placeholder: "Mailing Contact Name" %>
|
9
|
-
</div>
|
10
|
-
<div class="form-group field_with_errors">
|
11
|
-
<label><%= f.label :mccompanyname, "Company Name" %></label>
|
12
|
-
<%= f.text_field :mccompanyname, class: "form-control", placeholder: "Company Name", data: {autocomplete_source: Phcmemberspro::Members::Contact.order(:mccompanyname).map(&:mccompanyname)} %>
|
13
|
-
</div>
|
5
|
+
|
14
6
|
<div class="form-group field_with_errors">
|
15
7
|
<label><%= f.label :mcaddressl1, "Mailing Address Line1" %></label>
|
16
8
|
<%= f.text_field :mcaddressl1, class: "form-control", placeholder: "Mailing Street Address" %>
|
@@ -45,8 +45,6 @@
|
|
45
45
|
<tbody>
|
46
46
|
<% @members_contact.each do |members_contact| %>
|
47
47
|
<tr>
|
48
|
-
<td><%= members_contact.mccontactname %></td>
|
49
|
-
<td><%= members_contact.mccompanyname %></td>
|
50
48
|
<td><%= members_contact.mccity %></td>
|
51
49
|
<td><%= members_contact.mcprovince %></td>
|
52
50
|
<td><%= members_contact.mccountry %></td>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcmemberspro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BradPotts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|