phcmemberspro 1.6.3 → 1.6.5

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: e265082c597f67259bd5ad1b43378152aae4d429
4
- data.tar.gz: 827b47e6b2d33a732143fe82c074acd875251267
3
+ metadata.gz: b8dd4b493934476044eba3fbc00321edcdaebcda
4
+ data.tar.gz: b94743cef2b4c486fc36f1c3d0d037923221798d
5
5
  SHA512:
6
- metadata.gz: cd6554662a1c1ea1a997479a39567b356a30071d810ea6778ed53de0bacd89e14e43eabac4212a1bb26cb557ca8c23221a846ebeb16df67156783aeb2dd68b04
7
- data.tar.gz: 4b1fc68ad42a11ebe060723ed1423c2610d0d78998dcdacbf43a7495c2ef4821693f02bbec6c6f3bdd563c78be2b36d981af4a67db32abe276f8ae7c39d22037
6
+ metadata.gz: 670017c6adbdbeb763bde04578033a4406e1a5cd4c41d13eb8cd6ef0ebcbe32c9af3b8fa4fb0526668fa7792110ea98ce0e5b3f2252344c80b1ba0d2c44b3498
7
+ data.tar.gz: 674a8b204544e9bf4c6508f2c2ea3b3d8e6a72d6b189678ed7372557aff88429b1dd21f2211a205734f1dfa9e047d2e870b161e546d52c91aebf5e7b5e3d81e5
@@ -1,87 +1,67 @@
1
1
  require_dependency "phcmemberspro/application_controller"
2
2
 
3
3
  module Phcmemberspro
4
- class Members::ContactsController < ApplicationController
5
-
4
+ class Members::MainsController < ApplicationController
5
+
6
6
  # Security & Action Filters
7
7
  before_filter :authenticate_user!
8
8
  layout 'layouts/phcmemberspro/members/members_all.html.erb'
9
- before_action :set_members_contact, only: [:show, :edit, :update, :destroy]
10
-
11
- # Add Member Contact Information
12
- before_action :phc_member_mains_info
9
+ before_action :set_members_main, only: [:show, :edit, :update, :destroy]
13
10
 
14
- def phc_member_mains_info
15
- @main = Members::Main.find(params[:main_id])
16
- end
17
-
18
- # Member Contact Index
11
+ # Member Profile List
19
12
  def index
20
- main = Members::Main.find(params[:main_id])
21
- @members_contacts = main.contacts.scoped_to(current_account).order('mccontactname ASC')
13
+ @members_mains = Members::Main.scoped_to(current_account)
22
14
  end
23
15
 
24
- # Detailed Member Contact Information
16
+ # Detailed Member Profile
25
17
  def show
26
- main = Members::Main.find(params[:main_id])
27
- @members_contact = main.contacts.scoped_to(current_account).find(params[:id])
28
18
  end
29
19
 
30
- # New Contact
20
+ # New Member Profile
31
21
  def new
32
- main = Members::Main.find(params[:main_id])
33
- @members_contact = main.contacts.scoped_to(current_account).build
34
- respond_to do |format|
35
- format.html # new.html.erb
36
- format.xml { render :xml => @members_contact }
37
- end
22
+ @members_main = Members::Main.scoped_to(current_account).new
38
23
  end
39
24
 
40
- # Edit Contact
25
+ # Edit Member Profile
41
26
  def edit
42
- main = Members::Main.find(params[:main_id])
43
- @members_contact = main.contacts.scoped_to(current_account).find(params[:id])
44
27
  end
45
28
 
46
- # Create Action
29
+ # Create Member Profile Action
47
30
  def create
48
- @main = Members::Main.find(params[:main_id])
49
- @members_contact = @main.contacts.scoped_to(current_account).create(members_contact_params)
50
- if @members_contact.save
51
- redirect_to members_main_contacts_path, notice: 'Member contact information was successfully created.'
31
+ @members_main = Members::Main.scoped_to(current_account).new(members_main_params)
32
+ if @members_main.save
33
+ redirect_to members_mains_path, notice: 'Member profile was successfully created.'
52
34
  else
53
35
  render :new
54
36
  end
55
37
  end
56
38
 
57
- # Update Action
39
+ # Update Member Profile Action
58
40
  def update
59
- if @members_contact.scoped_to(current_account).update(members_contact_params)
60
- redirect_to members_main_contacts_path, notice: 'Member contact information was successfully updated.'
41
+ if @members_main.scoped_to(current_account).update(members_main_params)
42
+ redirect_to members_mains_path, notice: 'Member profile was successfully updated.'
61
43
  else
62
44
  render :edit
63
45
  end
64
46
  end
65
47
 
66
- # Delete Action
48
+ # Delete Member Profile Action
67
49
  def destroy
68
- @main = Members::Main.find(params[:main_id])
69
- @members_contact = @main.contacts.scoped_to(current_account).find(params[:id])
70
- @members_contact.destroy
71
- redirect_to members_main_contacts_path, notice: 'Member contact information was successfully destroyed.'
50
+ @members_main.scoped_to(current_account).destroy
51
+ redirect_to members_mains_path, notice: 'Member profile was successfully destroyed.'
72
52
  end
73
53
 
74
54
  private
75
55
 
76
56
  # Common Callbacks
77
- def set_members_contact
78
- @members_contact = Members::Contact.find(params[:id])
57
+ def set_members_main
58
+ @members_main = Members::Main.scoped_to(current_account).find(params[:id])
79
59
  end
80
60
 
81
61
  # White List
82
- def members_contact_params
83
- params.require(:members_contact).permit(:mccontactname, :mccompanyname, :mcaddressl1, :mcaddressl2, :mccity, :mcprovince, :mccountry, :mcpostalcode, :mcphone, :mcwebsite, :mcemail, :main_id, :account_id)
62
+ def members_main_params
63
+ params.require(:members_main).permit(:mfirstname, :mlastname, :mtitle, :memail, :mphone, :mnotes, :account_id)
84
64
  end
85
65
 
86
66
  end
87
- end
67
+ end
@@ -1,3 +1,3 @@
1
1
  module Phcmemberspro
2
- VERSION = "1.6.3"
2
+ VERSION = "1.6.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcmemberspro
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.3
4
+ version: 1.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts