Today I Learned

TIL, 2017-12-05

  • Ruby boolean to int: No easy way? Either you define class TrueClass def to_i 1 etc.
  • Reading Gitlab’s base service.
    • Allowable module
    • CurrentSettings to retrieve app things from database or cache.
    • NotificationService as a component to send emails. Each possible email is in the NotificationService.
    • EventCreateService which creates an Event row in the database if an event is created.
    • TodoService which is like the same as Event but for Todos.
  • TodosFinder does the thing where if something is passed add a where clause but if not just return the same thing. So you extract the actual querying logic into the finder.
def by_type(items)
  if type?
    items = items.where(target_type: type)
  end

  items
end

This project is maintained by daryllxd