Skip to content

Instantly share code, notes, and snippets.

View rajeevriitm's full-sized avatar

Rajeev rajeevriitm

View GitHub Profile
class Order < ApplicationRecord
belongs_to :customer
end
class Customer < ApplicationRecord
has_many :orders
def totals_by_customer
Student.joins(:orders).includes(:orders).map { |student|
[ student , student.orders.sum(:total) ]
}
@rajeevriitm
rajeevriitm / upwork.md
Last active September 9, 2016 18:56
Latest upwork job notification using Ruby Script

This is a Ruby script for notifying new job arrivals from your upwork feed. Notification includes a tome played using mpg321 applocation and linux desktop notification.You need to store the header file http request to "cred_file" mentioed (use your network inspector ). This output latest project name to a "project" file. Everything is self-explanotory. ( Dont forget to chmod +x )