adherent 0.1.0 → 0.1.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/adherent/payments_controller.rb +2 -0
- data/app/models/adherent/adhesion.rb +11 -4
- data/lib/adherent/version.rb +1 -1
- data/test/dummy/app/controllers/application_controller.rb +1 -6
- data/test/dummy/app/models/adherent/organism.rb +7 -0
- data/test/dummy/db/schema.rb +1 -1
- data/test/dummy/log/development.log +1850 -99224
- data/test/dummy/log/test.log +12091 -4755
- data/test/dummy/tmp/cache/assets/D0B/520/sprockets%2Fa659c61ab2078241e32ebaf671f87e41 +0 -0
- data/test/dummy/tmp/cache/assets/D48/B20/sprockets%2F5768e2da329c68c958acde5d26124de0 +0 -0
- data/test/dummy/tmp/cache/assets/D4B/C40/sprockets%2F2428f6c76bb4a5efb583e158681fb73d +0 -0
- data/test/dummy/tmp/cache/assets/D73/0F0/sprockets%2F5ba6d2f108d33e64b84fc4dd91960d6e +0 -0
- data/test/dummy/tmp/cache/assets/DB0/A80/sprockets%2F9fdb8e951f975dae3836c2ccf0f65a34 +0 -0
- data/test/fixtures/adherent/adhesions.yml +7 -5
- data/test/fixtures/adherent/coords.yml +2 -2
- data/test/fixtures/adherent/members.yml +4 -4
- data/test/fixtures/adherent/payments.yml +3 -6
- data/test/functional/adherent/adhesions_controller_test.rb +32 -0
- data/test/functional/adherent/coords_controller_test.rb +3 -3
- data/test/functional/adherent/members_controller_test.rb +7 -6
- data/test/functional/adherent/payments_controller_test.rb +10 -4
- data/test/functional/adherent/reglements_controller_test.rb +12 -8
- data/test/unit/adherent/adhesion_test.rb +8 -7
- data/test/unit/adherent/member_test.rb +2 -2
- metadata +6 -22
- data/test/dummy/db/migrate/20130810081835_create_adherent_members.adherent.rb +0 -13
- data/test/dummy/db/migrate/20130810081836_create_adherent_coords.adherent.rb +0 -17
- data/test/dummy/db/migrate/20130810081837_create_adherent_adhesions.adherent.rb +0 -15
- data/test/dummy/db/migrate/20130810081838_create_adherent_payments.adherent.rb +0 -18
- data/test/dummy/db/migrate/20130810081839_create_adherent_reglements.adherent.rb +0 -14
- data/test/dummy/db/migrate/20130810081840_add_organism_id_to_adherent_members.adherent.rb +0 -6
- data/test/dummy/test/functional/organisms_controller_test.rb +0 -49
- data/test/dummy/test/unit/helpers/organisms_helper_test.rb +0 -4
- data/test/dummy/test/unit/organism_test.rb +0 -7
- data/test/functional/adherent/adhesion_controller_test.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f46b619c95046614d77348c16f1722c1c0685689
|
4
|
+
data.tar.gz: 53af5fc158eeefd2ff4de7aa9accb91fc8a6f58e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d92233c98a0957408105cc3f7dd0aad60a1a93b0c26211c42085192b2a43b0940797164cb2eae3d80659d56e1824107534efb6bab193049461d78b1f6cee8ac
|
7
|
+
data.tar.gz: a1f744d115859f1993c9bdb6afd62c11fc9f0d10b9d410edd02ab85b83dbb21e64ec26816a56fadd8e5efcfd529dafee12f7a7fa452eecf2cef791ed778a047c
|
@@ -18,9 +18,15 @@ module Adherent
|
|
18
18
|
# un renouvellement d'adhésion
|
19
19
|
def self.next_adh_values(adh = nil)
|
20
20
|
if adh
|
21
|
-
{:from_date =>I18n.l(adh.read_attribute(:to_date)+1),
|
21
|
+
{:from_date =>I18n.l(adh.read_attribute(:to_date)+1),
|
22
|
+
:to_date=>I18n.l(adh.read_attribute(:to_date).years_since(1)),
|
23
|
+
amount: adh.amount
|
24
|
+
}
|
22
25
|
else
|
23
|
-
{:from_date=>I18n.l(Date.today),
|
26
|
+
{:from_date=>I18n.l(Date.today),
|
27
|
+
:to_date=>I18n.l(Date.today.years_since(1) - 1),
|
28
|
+
amount:0
|
29
|
+
}
|
24
30
|
end
|
25
31
|
end
|
26
32
|
|
@@ -54,13 +60,14 @@ module Adherent
|
|
54
60
|
end
|
55
61
|
|
56
62
|
# ajoute un réglement provenant d'un payment pour un montant donné;
|
57
|
-
# renvoie le
|
63
|
+
# renvoie le règlement qui a été ajouté.
|
58
64
|
def add_reglement(payment_id, montant)
|
59
65
|
imputation = [montant, due].min
|
60
66
|
r = reglements.new(amount:imputation)
|
61
67
|
r.payment_id = payment_id
|
62
68
|
r.save!
|
63
|
-
|
69
|
+
r
|
70
|
+
|
64
71
|
end
|
65
72
|
|
66
73
|
|
data/lib/adherent/version.rb
CHANGED
@@ -6,11 +6,6 @@ class ApplicationController < ActionController::Base
|
|
6
6
|
protected
|
7
7
|
|
8
8
|
def find_organism
|
9
|
-
|
10
|
-
@organism = Organism.find_by_id(session[:organism])
|
11
|
-
else
|
12
|
-
flash[:alert] = 'Vous devez d\'abord choisir un organisme'
|
13
|
-
redirect_to main_app.organisms_path
|
14
|
-
end
|
9
|
+
@organism = Organism.new(title:'Mon association', status:'Association')
|
15
10
|
end
|
16
11
|
end
|
data/test/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended to check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:version =>
|
14
|
+
ActiveRecord::Schema.define(:version => 20130810074112) do
|
15
15
|
|
16
16
|
create_table "adherent_adhesions", :force => true do |t|
|
17
17
|
t.date "from_date"
|