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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc6dca79beed259976b9c6ec1d5241a47ec03a0f
4
- data.tar.gz: 2313397ce9e7ca2da3c4c74a847a549f99b3314a
3
+ metadata.gz: 06aac872b7e31bf0558bbc4571a41e8b87ff8349
4
+ data.tar.gz: f1f20865bd98b04b745ddb7d434e0da71a59cb66
5
5
  SHA512:
6
- metadata.gz: a36c3650d9ef1ca27d89561f47095422f5849e0aaa1e8da23ed6d395e60228e62a30e30a43c2f2e759028503006d13372ed3a7cab8ec366675d42de86ef9a5fb
7
- data.tar.gz: 8dd7fec43e5a3b7570b4f38ba8ca6cd3b12ca3db2f62259396ff3bb10aa46bd1938cc16d2436d79e173eff2b59775b2ef9852c682dcd72bcc3ac497f8228113e
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
- class Members::Business < ActiveRecord::Base
3
- end
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 :listings, class_name: 'Members::Listing', dependent: :destroy
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>
@@ -2,8 +2,6 @@ class CreatePhcmembersproMembersContacts < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :phcmemberspro_members_contacts do |t|
4
4
 
5
- t.string :mccontactname
6
- t.string :mccompanyname
7
5
  t.string :mcaddressl1
8
6
  t.string :mcaddressl2
9
7
  t.string :mccity
@@ -7,6 +7,7 @@ class CreatePhcmembersproMembersBusinesses < ActiveRecord::Migration
7
7
  t.string :mbaddressl1
8
8
  t.string :mbaddressl2
9
9
  t.string :mbcity
10
+ t.string :mbprovince
10
11
  t.string :mbcountry
11
12
  t.string :mbpostalcode
12
13
  t.string :mbphone
@@ -1,3 +1,3 @@
1
1
  module Phcmemberspro
2
- VERSION = "5.0.0"
2
+ VERSION = "5.0.1"
3
3
  end
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.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-14 00:00:00.000000000 Z
11
+ date: 2016-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails