Sha256: 50664a88b04961a4409b283da096b7d9e075c5cdfd103039463a424860613523

Contents?: true

Size: 207 Bytes

Versions: 258

Compression:

Stored size: 207 Bytes

Contents

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

Version data entries

258 entries across 258 versions & 8 rubygems

Version Path
active_scaffold-3.4.43 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.42 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.41.1 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.41 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.40 lib/active_scaffold/extensions/to_label.rb
active_scaffold_vho-4.0.0 lib/active_scaffold/extensions/to_label.rb
active_scaffold_vho-3.2.14 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.39 lib/active_scaffold/extensions/to_label.rb
active_scaffold_vho-3.2.13 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.38 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.37 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.36 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.35 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.34 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.33 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.32 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.31 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.30 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.29 lib/active_scaffold/extensions/to_label.rb
active_scaffold-3.4.28 lib/active_scaffold/extensions/to_label.rb