app/models/data_object.rb
# NOTE - if you plan on calling this, you are behooved by adding object_title
# to your selects. You MUST select description and data_type_id. TODO - this
# really doesn't belong here. Truncation belongs in the view (or a helper).
# Also, it duplicates SOME of the logic of best_title, but not all of it
# (why?). Very poor design.
if you plan on calling this, you are behooved by adding object_title
to your selects. You MUST select description and data_type_id. TODO - this
really doesn't belong here. Truncation belongs in the view (or a helper).
Also, it duplicates SOME of the logic of best_title, but not all of it
(why?). Very poor design.
if you plan on calling this you are behooved by adding object_title to your selects . You MUST select description and data_type_id . TODO - this really doesn ' t belong here . Truncation belongs in the view ( or a helper ) . Also it duplicates SOME of the logic of best_title but not all of it ( why? ) . Very poor design .
def short_title
    return safe_object_title unless safe_object_title.blank?
    return data_type.label if description.blank?
    st = description.gsub(/\n.*$/, '')
    st = st[0..29] + '...' if st.length > 32
    st
  end
def short_title return safe_object_title unless safe_object_title . blank? return data_type . label if description . blank? st = description . gsub ( / \n .*$ / , '' ) st = st [ 0 .. 29 ] + '...' if st . length > 32 st end
NOTE - if you plan on calling this, you are behooved by adding object_title
to your selects.
NOTE - if you plan on calling this you are behooved by adding object_title to your selects .
# TODO - ideally, we should extract some of the logic from data_objects/show # to make this "Image of Procyon Lotor".