Sha256: b57364780df81b23f53266ac3e479c3a5e121ac04471427457832e35d424da01

Contents?: true

Size: 202 Bytes

Versions: 7

Compression:

Stored size: 202 Bytes

Contents

# the ever-useful to_label method
class ActiveRecord::Base
  def to_label
    %i[name label title to_s].each do |attribute|
      return send(attribute).to_s if respond_to?(attribute)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_scaffold-3.5.5 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.6.0.pre lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.5.4 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.5.3 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.5.2 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.5.1 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.5.0 lib/active_scaffold/extensions/to_label.rb