This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var width = 750; | |
var height = 500; | |
var radius = 200; | |
var strokeColor = "#999"; | |
var strokeOpacity = 0.75; | |
var labelMargin = radius + 20; | |
var concentric = []; | |
for(var i = 1; i <= 10; i++) { | |
concentric.push((radius * i) / 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# coach = Coach.first | |
# coach.sessions_count(:started_at) | |
# coach.coachees_count(:created_at) | |
# coach.sessions_sum(:price, :started_at) | |
class Coach < ActiveRecord::Base | |
include Metric | |
metrics_for :sessions, :coachees |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Speciality < ActiveRecord::Base | |
validates :code, presence: true | |
private | |
def method_missing(method, *args, &block) | |
if method.to_s =~ /^(.+)[?]$/ | |
run_code_comparation_method($1, *args, &block) | |
else | |
super | |
end |
NewerOlder