adherent 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/adherent/payments_controller.rb +2 -0
  3. data/app/models/adherent/adhesion.rb +11 -4
  4. data/lib/adherent/version.rb +1 -1
  5. data/test/dummy/app/controllers/application_controller.rb +1 -6
  6. data/test/dummy/app/models/adherent/organism.rb +7 -0
  7. data/test/dummy/db/schema.rb +1 -1
  8. data/test/dummy/log/development.log +1850 -99224
  9. data/test/dummy/log/test.log +12091 -4755
  10. data/test/dummy/tmp/cache/assets/D0B/520/sprockets%2Fa659c61ab2078241e32ebaf671f87e41 +0 -0
  11. data/test/dummy/tmp/cache/assets/D48/B20/sprockets%2F5768e2da329c68c958acde5d26124de0 +0 -0
  12. data/test/dummy/tmp/cache/assets/D4B/C40/sprockets%2F2428f6c76bb4a5efb583e158681fb73d +0 -0
  13. data/test/dummy/tmp/cache/assets/D73/0F0/sprockets%2F5ba6d2f108d33e64b84fc4dd91960d6e +0 -0
  14. data/test/dummy/tmp/cache/assets/DB0/A80/sprockets%2F9fdb8e951f975dae3836c2ccf0f65a34 +0 -0
  15. data/test/fixtures/adherent/adhesions.yml +7 -5
  16. data/test/fixtures/adherent/coords.yml +2 -2
  17. data/test/fixtures/adherent/members.yml +4 -4
  18. data/test/fixtures/adherent/payments.yml +3 -6
  19. data/test/functional/adherent/adhesions_controller_test.rb +32 -0
  20. data/test/functional/adherent/coords_controller_test.rb +3 -3
  21. data/test/functional/adherent/members_controller_test.rb +7 -6
  22. data/test/functional/adherent/payments_controller_test.rb +10 -4
  23. data/test/functional/adherent/reglements_controller_test.rb +12 -8
  24. data/test/unit/adherent/adhesion_test.rb +8 -7
  25. data/test/unit/adherent/member_test.rb +2 -2
  26. metadata +6 -22
  27. data/test/dummy/db/migrate/20130810081835_create_adherent_members.adherent.rb +0 -13
  28. data/test/dummy/db/migrate/20130810081836_create_adherent_coords.adherent.rb +0 -17
  29. data/test/dummy/db/migrate/20130810081837_create_adherent_adhesions.adherent.rb +0 -15
  30. data/test/dummy/db/migrate/20130810081838_create_adherent_payments.adherent.rb +0 -18
  31. data/test/dummy/db/migrate/20130810081839_create_adherent_reglements.adherent.rb +0 -14
  32. data/test/dummy/db/migrate/20130810081840_add_organism_id_to_adherent_members.adherent.rb +0 -6
  33. data/test/dummy/test/functional/organisms_controller_test.rb +0 -49
  34. data/test/dummy/test/unit/helpers/organisms_helper_test.rb +0 -4
  35. data/test/dummy/test/unit/organism_test.rb +0 -7
  36. 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: 4886004175e5dadc3cb3a6afefcc1c3e174007b3
4
- data.tar.gz: ca7a080613104ec7a0a31fc8a54402b58e913fcf
3
+ metadata.gz: f46b619c95046614d77348c16f1722c1c0685689
4
+ data.tar.gz: 53af5fc158eeefd2ff4de7aa9accb91fc8a6f58e
5
5
  SHA512:
6
- metadata.gz: 8ebe1f4885984dfbf6db5bb28db12ea75cb47137682fdbd251fcd3782948ad5049e7bf2939d7b9906896db78e0e3f9bce0cc6edbb5836d1783e9b23fe254f8ed
7
- data.tar.gz: 4e7c161d5bf8737d8c47b1a85aeb7efd29d3c3264924912776ad2fe6128df51aa4bbfc0920147e47b7de0c4968f1796fc486afccb2964bcad9193efe42c0e604
6
+ metadata.gz: 5d92233c98a0957408105cc3f7dd0aad60a1a93b0c26211c42085192b2a43b0940797164cb2eae3d80659d56e1824107534efb6bab193049461d78b1f6cee8ac
7
+ data.tar.gz: a1f744d115859f1993c9bdb6afd62c11fc9f0d10b9d410edd02ab85b83dbb21e64ec26816a56fadd8e5efcfd529dafee12f7a7fa452eecf2cef791ed778a047c
@@ -26,9 +26,11 @@ module Adherent
26
26
  end
27
27
 
28
28
  def edit
29
+ @payment = @member.payments.find(params[:id])
29
30
  end
30
31
 
31
32
  def show
33
+ @payment = @member.payments.find(params[:id])
32
34
  end
33
35
 
34
36
  # DELETE /payment/1
@@ -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), :to_date=>I18n.l(adh.read_attribute(:to_date).years_since(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), :to_date=>I18n.l(Date.today.years_since(1) - 1)}
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 montant qui a été effectivement imputé sur cette adhésion.
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
- imputation
69
+ r
70
+
64
71
  end
65
72
 
66
73
 
@@ -1,3 +1,3 @@
1
1
  module Adherent
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -6,11 +6,6 @@ class ApplicationController < ActionController::Base
6
6
  protected
7
7
 
8
8
  def find_organism
9
- if session[:organism]
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
@@ -0,0 +1,7 @@
1
+ module Adherent
2
+ class Organism < ActiveRecord::Base
3
+ attr_accessible :status, :title
4
+
5
+ has_many :members, class_name:'Adherent::Member'
6
+ end
7
+ end
@@ -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 => 20130810081840) do
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"