Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def availability
- # Disponibilità: 3 possiblità Available, NON Available (e se c'è una transazione visualizzare il nome del tenant
- # Q4 2017 (cioè la data di disponibilità futura)
- if super == :not_available
- if SurfacesTrade.where(surface: object).any?
- h.link_to SurfacesTrade.where(surface: object).first.trade.buyer.company_name, SurfacesTrade.where(surface: object).first.trade.buyer
- else
- super.text
- end
- elsif super == :available
- unless (object.availability_since_year.nil? && object.availability_since_quarter.nil?)
- unless (object.availability_since_year.empty? && object.availability_since_quarter.empty?)
- "#{object.availability_since_quarter.capitalize} - #{object.availability_since_year}"
- else
- super.text
- end
- end
- else
- h.not_available
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement