molten-trunk/molten5_withgrid/lib/acts_as_viewable.rb
# Returns the record and adds a viewing. If the record has a +views+ method
# that counts the number of views, this is incremented.
Returns the record and adds a viewing. If the record has a +views+ method
that counts the number of views, this is incremented.
Returns the record and adds a viewing . If the record has a + views + method that counts the number of views this is incremented .
def view(id,contact)
            record = find(:first, :conditions => ["sf_id LIKE ?", "#{id}%"])
            raise ActiveRecord::RecordNotFound if record.nil?
            viewing = record.viewings.create!(:viewable => record, :sfcontact => contact)
            if record.respond_to?(:views) and record.respond_to?(:settings) and !record.settings.nil?
              record.settings.increment!(:views) 
            end
            return record
          end
def view ( id , contact ) record = find ( :first , :conditions => [ "sf_id LIKE ?" , "#{id}%" ] ) raise ActiveRecord :: RecordNotFound if record . nil? viewing = record . viewings . create! ( :viewable => record , :sfcontact => contact ) if record . respond_to? ( :views ) and record . respond_to? ( :settings ) and ! record . settings . nil? record . settings . increment! ( :views ) end return record end
Returns the record and adds a viewing.
Returns the record and adds a viewing .
id
contact