Skip to content

hummingbird-me/kitsu-server

This branch is 1 commit ahead of, 1906 commits behind the-future.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

141adca Â· Dec 28, 2018
Dec 28, 2018
Apr 28, 2016
Nov 14, 2018
Dec 28, 2018
Dec 17, 2018
Sep 22, 2015
Sep 22, 2015
Dec 28, 2018
Sep 22, 2015
Sep 28, 2016
Mar 30, 2016
Aug 31, 2018
Jan 4, 2017
Oct 11, 2016
Dec 7, 2016
Oct 23, 2017
Sep 27, 2015
Oct 24, 2018
Sep 19, 2018
Oct 22, 2016
Nov 12, 2018
Nov 12, 2018
Mar 4, 2017
Aug 31, 2018
Dec 5, 2017
Dec 7, 2017
Apr 25, 2017
Sep 22, 2015

Repository files navigation

Kitsu Server

Build Status Code Climate Test Coverage


This is our server repository. It contains the rails application for Kitsu.
Check out the meta, client and api docs repositories.


This README outlines the details of collaborating on this application.

Styleguide

Styleguide Amendments

These amendments are listed below, though we may forget some. Rubocop will help you, and we have a .rubocop.yml which we develop with.

Rails

ActiveRecord Models

  • Group macro-style methods at the beginning of the class definition, in the following order:

    class User < ActiveRecord::Base
      # put the default scope at the top
      default_scope { includes(:favorites) }
    
      # then the constants
      COLORS = %w[red green blue]
    
      # then named scopes
      scope(:banned) { where(banned: true) }
    
      # then any mixin-style "acts_as_*" and similar methods
      acts_as_sortable
      devise :database_authenticable, :registerable, :recoverable,
             :validatable, :confirmable
    
      # then field-type macros such as enum or has_attached_file
      enum rating_system: %i[smilies stars]
      has_attached_file :avatar
    
      # then associations
      has_many :library_entries
    
      # then validation
      validates :email, presence: true
      validates name, presence: true
    
      # and then callbacks
      before_save :do_the_thing
    
      # ... and finally the rest of the methods!
    end