app/controllers/extensions_controller.rb
#
# GET /extensions/directory
#
# Return the three most recently updated and created extensions.
#
GET /extensions/directory
Return the three most recently updated and created extensions.
GET / extensions / directory Return the three most recently updated and created extensions .
def directory
    @recently_updated_extensions = Extension.
      filter_private(current_user).
      includes(:extension_versions).
      where.not(owner: nil).
      where("extension_versions.version != 'master'").
      order("extension_versions.created_at DESC").
      limit(4)
    @most_downloaded_extensions = Extension.
      filter_private(current_user).
      includes(:extension_versions).
      where.not(owner: nil).
      ordered_by('most_downloaded').
      limit(6)
    @top_tags = Tag.where(
      id: Tagging.select("tag_id, count(*) as count").
        group("tag_id").
        order("count DESC").
        limit(15).
        map(&:tag_id)
    ).sort_by(&:name)
    @top_collections = Collection.rank(:row_order).limit(10)
    @extension_count = Extension.count
    @user_count = User.count
  end
def directory @recently_updated_extensions = Extension . filter_private ( current_user ) . includes ( :extension_versions ) . where . not ( owner : nil ) . where ( "extension_versions.version != 'master'" ) . order ( "extension_versions.created_at DESC" ) . limit ( 4 ) @most_downloaded_extensions = Extension . filter_private ( current_user ) . includes ( :extension_versions ) . where . not ( owner : nil ) . ordered_by ( 'most_downloaded' ) . limit ( 6 ) @top_tags = Tag . where ( id : Tagging . select ( "tag_id, count(*) as count" ) . group ( "tag_id" ) . order ( "count DESC" ) . limit ( 15 ) . map ( & :tag_id ) ) . sort_by ( & :name ) @top_collections = Collection . rank ( :row_order ) . limit ( 10 ) @extension_count = Extension . count @user_count = User . count end
GET /extensions/directory
Return the three most recently updated and created extensions.
GET / extensions / directory Return the three most recently updated and created extensions .