Sha256: 9333b9073031e455dbe3ceb99344c477ba98789700208a1ef195bb9e65c1e020
Contents?: true
Size: 539 Bytes
Versions: 91
Compression:
Stored size: 539 Bytes
Contents
module Addresses::Base extend ActiveSupport::Concern included do belongs_to :addressable, polymorphic: true belongs_to :country, class_name: "Addresses::Country" belongs_to :region, class_name: "Addresses::Region" def valid_address? address_one? && city? && region_id? && country_id? && postal_code? end def all_blank?(attributes = {}) return super(attributes) unless attributes.empty? !(address_one? || address_two? || city? || region_id? || country_id? || postal_code?) end end end
Version data entries
91 entries across 91 versions & 1 rubygems