This file contains hidden or 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 hidden or 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 |
This file contains hidden or 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
require 'capistrano/setup' | |
require 'capistrano/deploy' | |
require 'capistrano/rvm' | |
require 'capistrano/bundler' | |
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. | |
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } |
NewerOlder