Sha256: a47190a1abf5e43e9440c22348f5af299647c13508b38aa6bae100ff3dfedae4
Contents?: true
Size: 330 Bytes
Versions: 10
Compression:
Stored size: 330 Bytes
Contents
class Endereco < ActiveRecord::Base belongs_to :cidade delegate :estado, to: :cidade, allow_nil: true belongs_to :usuario, :class_name => "Usuario", :foreign_key => "usuario_id" def to_s if logradouro.present? "#{logradouro}, #{numero} #{complemento}, #{bairro}, #{cidade.try(:cidade_estado)}" end end end
Version data entries
10 entries across 10 versions & 1 rubygems