Sha256: f7c569aa920aca8f2c56b314ac1053ff9343888f043164808b637e024d834044
Contents?: true
Size: 301 Bytes
Versions: 39
Compression:
Stored size: 301 Bytes
Contents
# the ever-useful to_label method class ActiveRecord::Base def to_label to_label_method = ActiveScaffold::Registry.cache :to_label, self.class.name do %i[name label title to_s].find { |attribute| respond_to?(attribute) } end send(to_label_method).to_s if to_label_method end end
Version data entries
39 entries across 39 versions & 1 rubygems