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 +7 -0
- data/README.md +63 -1
- data/app/controllers/customer_vault/corporations_controller.rb +1 -1
- data/app/models/customer_vault/person.rb +4 -0
- data/app/views/customer_vault/corporations/_form.html.slim +4 -0
- data/app/views/customer_vault/corporations/_show_details.html.slim +4 -0
- data/config/locales/fr.yml +4 -0
- data/db/migrate/20150520104617_add_legal_form_to_customer_vault_corporations.rb +5 -0
- data/db/migrate/20150520105342_add_capital_to_customer_vault_corporations.rb +5 -0
- data/db/migrate/20150520105426_add_immatriculation_number_1_to_customer_vault_corporations.rb +5 -0
- data/db/migrate/20150520105439_add_immatriculation_number_2_to_customer_vault_corporations.rb +5 -0
- data/lib/customer_vault/version.rb +1 -1
- data/spec/dummy/db/schema.rb +12 -8
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -15507
- data/spec/dummy/log/test.log +1 -69556
- data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/HeHWjP35NIHplJXmAMutQEw3NgEfpjqYMtGKr9gh1K0.cache +1 -0
- data/spec/factories/dorsale_address.rb +1 -1
- data/spec/models/customer_vault/corporation_spec.rb +4 -0
- metadata +922 -936
- data/spec/dummy/log/bin/test.log +0 -0
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
|
-
|
|
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
|
|
@@ -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?("://")
|
data/config/locales/fr.yml
CHANGED
|
@@ -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:
|
data/spec/dummy/db/schema.rb
CHANGED
|
@@ -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:
|
|
14
|
+
ActiveRecord::Schema.define(version: 20150520105439) do
|
|
15
15
|
|
|
16
|
-
create_table "customer_vault_corporations", force:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
90
|
+
create_table "tags", force: :cascade do |t|
|
|
87
91
|
t.string "name"
|
|
88
92
|
t.integer "taggings_count", default: 0
|
|
89
93
|
end
|
data/spec/dummy/db/test.sqlite3
CHANGED
|
Binary file
|