customer_vault 1.2.9 → 1.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a7efac29df8356cfb56f63db45f21e89b34b8b0a
4
+ data.tar.gz: 41b656df007addd542dc17399d81f2fe18fbc206
5
+ SHA512:
6
+ metadata.gz: d7081dd00fa99ec079eb0882248d9ac5448bd13c57c3a4b9fcf1990d47dafa15246d7ab14156a1d242e24f796ef73cf79ef9335e68ac5c517ef01331596dc858
7
+ data.tar.gz: 22fc2f5eee5721cbfd8d895c5161ee01d14678335ec1e29ac56fdbf129fd59bab937ebadbe20dd6b486424e964fc92329a57e3f9bd79c4020a5e3efc2db6648b
data/README.md CHANGED
@@ -1,3 +1,65 @@
1
1
  # CustomerVault
2
2
 
3
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. (see LICENSE file)
3
+ ## Install
4
+
5
+ First step is to add CustomerVault to `Gemfile` :
6
+
7
+ ```ruby
8
+ gem "customer_vault"
9
+ ```
10
+
11
+ and install it :
12
+
13
+ ```bash
14
+ bundle install
15
+ ````
16
+
17
+ Then, you need mount it in `config/routes.rb` :
18
+
19
+ ```ruby
20
+ mount Dorsale::Engine, at: "/dorsale"
21
+ mount CustomerVault::Engine, at: "/customer_vault"
22
+ ```
23
+
24
+ CustomerVault depends on Dorsale, so you need to mount it too.
25
+
26
+ After mount, you need to import and run CustomerVault (and it's dependencies) migrations :
27
+
28
+ ```bash
29
+ rake railties:install:migrations
30
+ rake db:migrate
31
+ ```
32
+
33
+ You have to perform this operation after each CustomerVault update to import eventual new migrations.
34
+
35
+ You now need to import JS and CSS files in `app/assets/javascripts/application.js` :
36
+
37
+ ```
38
+ //= require dorsale/all
39
+ //= require customer_vault/all
40
+ ```
41
+
42
+ And in `app/assets/stylesheets/application.sass` :
43
+
44
+ ```
45
+ @import dorsale/all
46
+ @import customer_vault/all
47
+ ```
48
+
49
+ Now, CustomerVault works but is not secure. CustomerVault has a permissive `CustomerVault::Ability` class (CanCan gem) that does not control any access. You need to change the default `Ability` to use :
50
+
51
+ Create this `app/controllers/customer_vault/application_controller.rb` file :
52
+
53
+ ```ruby
54
+ require_dependency CustomerVault::Engine.root.join("app/controllers/customer_vault/application_controller.rb")
55
+
56
+ module CustomerVault
57
+ class ApplicationController
58
+ def current_ability
59
+ @current_ability ||= ::Ability.new(current_user)
60
+ end
61
+ end
62
+ end
63
+ ```
64
+
65
+ And you just have to complete your existing `Ability.rb` using CustomerVault `Ability` as example.
@@ -71,7 +71,7 @@ module CustomerVault
71
71
 
72
72
  def permitted_params
73
73
  [
74
- :name, {:tag_list => []}, :email, :www, :phone, :fax,
74
+ :name, {:tag_list => []}, :email, :www, :phone, :fax, :capital, :immatriculation_number_1, :immatriculation_number_2, :legal_form,
75
75
  :address_attributes => [:street, :street_bis, :zip, :city, :country]
76
76
  ]
77
77
  end
@@ -4,6 +4,10 @@ module CustomerVault
4
4
 
5
5
  acts_as_taggable
6
6
 
7
+ def tags_on(*args)
8
+ super(*args).order(:name)
9
+ end
10
+
7
11
  has_many :comments, -> { order("id DESC") }, class_name: "Dorsale::Comment", as: :commentable
8
12
  has_one :address, class_name: 'Dorsale::Address', as: :addressable, inverse_of: :addressable
9
13
  accepts_nested_attributes_for :address, allow_destroy: true
@@ -5,6 +5,10 @@
5
5
  = f.input :www
6
6
  = f.input :phone
7
7
  = f.input :fax
8
+ = f.input :capital
9
+ = f.input :immatriculation_number_1
10
+ = f.input :immatriculation_number_2
11
+ = f.input :legal_form
8
12
 
9
13
  / Temporaire - A refactoriser
10
14
  = f.simple_fields_for :address do |af|
@@ -7,6 +7,10 @@
7
7
  = context_info corporation.class.human_attribute_name(:email), corporation.email
8
8
  = context_info corporation.class.human_attribute_name(:phone), corporation.phone
9
9
  = context_info corporation.class.human_attribute_name(:fax), corporation.fax
10
+ = context_info corporation.class.human_attribute_name(:capital), corporation.capital.to_s
11
+ = context_info corporation.class.human_attribute_name(:immatriculation_number_1), corporation.immatriculation_number_1
12
+ = context_info corporation.class.human_attribute_name(:immatriculation_number_2), corporation.immatriculation_number_2
13
+ = context_info corporation.class.human_attribute_name(:legal_form), corporation.legal_form
10
14
 
11
15
  - if corporation.www.present?
12
16
  - if corporation.www.to_s.include?("://")
@@ -38,6 +38,10 @@ fr:
38
38
  customer_vault/person: &customer_vault_person_attributes
39
39
  context: "Contexte"
40
40
  all_tags: "Tous les tags"
41
+ capital: "Capital"
42
+ immatriculation_number_1: "SIREN"
43
+ immatriculation_number_2: "RCS"
44
+ legal_form: "Forme juridique"
41
45
  customer_vault/individual:
42
46
  <<: *customer_vault_person_attributes
43
47
  customer_vault/corporation:
@@ -0,0 +1,5 @@
1
+ class AddLegalFormToCustomerVaultCorporations < ActiveRecord::Migration
2
+ def change
3
+ add_column :customer_vault_corporations, :legal_form, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddCapitalToCustomerVaultCorporations < ActiveRecord::Migration
2
+ def change
3
+ add_column :customer_vault_corporations, :capital, :integer
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddImmatriculationNumber1ToCustomerVaultCorporations < ActiveRecord::Migration
2
+ def change
3
+ add_column :customer_vault_corporations, :immatriculation_number_1, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddImmatriculationNumber2ToCustomerVaultCorporations < ActiveRecord::Migration
2
+ def change
3
+ add_column :customer_vault_corporations, :immatriculation_number_2, :string
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module CustomerVault
2
- VERSION = "1.2.9"
2
+ VERSION = "1.2.10"
3
3
  end
@@ -11,9 +11,9 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20150421113226) do
14
+ ActiveRecord::Schema.define(version: 20150520105439) do
15
15
 
16
- create_table "customer_vault_corporations", force: true do |t|
16
+ create_table "customer_vault_corporations", force: :cascade do |t|
17
17
  t.string "name"
18
18
  t.string "email"
19
19
  t.string "phone"
@@ -21,9 +21,13 @@ ActiveRecord::Schema.define(version: 20150421113226) do
21
21
  t.datetime "created_at"
22
22
  t.datetime "updated_at"
23
23
  t.string "www"
24
+ t.string "legal_form"
25
+ t.integer "capital"
26
+ t.string "immatriculation_number_1"
27
+ t.string "immatriculation_number_2"
24
28
  end
25
29
 
26
- create_table "customer_vault_individuals", force: true do |t|
30
+ create_table "customer_vault_individuals", force: :cascade do |t|
27
31
  t.string "first_name"
28
32
  t.string "last_name"
29
33
  t.string "email"
@@ -38,7 +42,7 @@ ActiveRecord::Schema.define(version: 20150421113226) do
38
42
  t.datetime "updated_at"
39
43
  end
40
44
 
41
- create_table "customer_vault_links", force: true do |t|
45
+ create_table "customer_vault_links", force: :cascade do |t|
42
46
  t.string "title"
43
47
  t.integer "alice_id"
44
48
  t.string "alice_type"
@@ -48,7 +52,7 @@ ActiveRecord::Schema.define(version: 20150421113226) do
48
52
  t.datetime "updated_at"
49
53
  end
50
54
 
51
- create_table "dorsale_addresses", force: true do |t|
55
+ create_table "dorsale_addresses", force: :cascade do |t|
52
56
  t.string "street"
53
57
  t.string "street_bis"
54
58
  t.string "city"
@@ -60,7 +64,7 @@ ActiveRecord::Schema.define(version: 20150421113226) do
60
64
  t.string "addressable_type"
61
65
  end
62
66
 
63
- create_table "dorsale_comments", force: true do |t|
67
+ create_table "dorsale_comments", force: :cascade do |t|
64
68
  t.integer "user_id"
65
69
  t.string "user_type"
66
70
  t.integer "commentable_id"
@@ -70,7 +74,7 @@ ActiveRecord::Schema.define(version: 20150421113226) do
70
74
  t.datetime "updated_at", null: false
71
75
  end
72
76
 
73
- create_table "taggings", force: true do |t|
77
+ create_table "taggings", force: :cascade do |t|
74
78
  t.integer "tag_id"
75
79
  t.integer "taggable_id"
76
80
  t.string "taggable_type"
@@ -83,7 +87,7 @@ ActiveRecord::Schema.define(version: 20150421113226) do
83
87
  add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true
84
88
  add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context"
85
89
 
86
- create_table "tags", force: true do |t|
90
+ create_table "tags", force: :cascade do |t|
87
91
  t.string "name"
88
92
  t.integer "taggings_count", default: 0
89
93
  end
Binary file