Fix camelcase attribute

This commit is contained in:
Paul Chavard 2018-02-21 16:28:11 +01:00
parent 9481f12294
commit 0b2ad653fa
4 changed files with 7 additions and 3 deletions

View file

@ -2,4 +2,8 @@ class Exercice < ActiveRecord::Base
belongs_to :etablissement
validates :ca, presence: true, allow_blank: false, allow_nil: false
def date_fin_exercice
super || dateFinExercice
end
end

View file

@ -49,7 +49,7 @@
.col-xs-8.entreprise-info
- @facade.etablissement.exercices.each_with_index do |exercice, index|
%strong
= "#{exercice.dateFinExercice.year} : "
= "#{exercice.date_fin_exercice.year} : "
= number_to_currency(exercice.ca)
%br

View file

@ -44,7 +44,7 @@
%th Exercices :
%td
- etablissement.exercices.each_with_index do |exercice, index|
= "#{exercice.dateFinExercice.year} : "
= "#{exercice.date_fin_exercice.year} : "
= number_to_currency(exercice.ca)
%br
- if entreprise.rna_information.present?

View file

@ -1,7 +1,7 @@
FactoryBot.define do
factory :exercice do
ca '12345678'
dateFinExercice "2014-12-30 23:00:00"
date_fin_exercice "2014-12-30 23:00:00"
date_fin_exercice_timestamp 1419980400
association :etablissement, factory: [:etablissement]
end