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 Stylist < ActiveRecord::Base | |
include ActionView::Helpers::NumberHelper | |
scope :active, -> { where(active: true) } | |
scope :inactive, -> { where(active: false) } | |
scope :with_active_salon, -> { joins(:salon).merge(Salon.active) } | |
scope :non_receptionist, -> { | |
joins('LEFT JOIN user_role ON user_role.user_id = stylist.user_id') | |
.joins('LEFT JOIN role ON user_role.role_id = role.id') | |
.where('role.code != ? OR role.code IS NULL', 'RECEPTIONIST') |
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
gem_group :development, :test do | |
gem 'pg' | |
gem 'pry' | |
gem 'devise' | |
gem 'rspec-rails' | |
gem 'factory_bot_rails' | |
gem 'capybara' | |
gem 'selenium-webdriver' | |
gem 'chromedriver-helper' |
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 'open-uri' | |
require 'pry' | |
class Document | |
DOT_PADDING = 3 | |
def initialize(text) | |
@words = text.gsub(/-/, ' ').split | |
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
[ | |
{ | |
name: 'Hamburger', | |
price: 10 | |
}, | |
{ | |
name: 'Cheeseburger', | |
price: 11 | |
}, | |
{ |
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
# Generated on 2014-11-05 using generator-angular 0.9.8 | |
'use strict' | |
# # Globbing | |
# for performance reasons we're only matching one level down: | |
# 'test/spec/{,*/}*.js' | |
# use this if you want to recursively match all subfolders: | |
# 'test/spec/**/*.js' | |
module.exports = (grunt) -> | |
# Load grunt tasks automatically |
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
# Generated on 2014-11-05 using generator-angular 0.9.8 | |
'use strict' | |
# # Globbing | |
# for performance reasons we're only matching one level down: | |
# 'test/spec/{,*/}*.js' | |
# use this if you want to recursively match all subfolders: | |
# 'test/spec/**/*.js' | |
module.exports = (grunt) -> | |
# Load grunt tasks automatically |
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
gulp.task('test', function() { | |
server.listen(3000); | |
return gulp.src('spec/test.js') | |
.pipe(jasmine()) | |
.on('end', function () { | |
server.close(); | |
exit(); | |
}); | |
}); |
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
gulp.task('start-server', function() { | |
return server.listen(3000); | |
}); | |
gulp.task('jasmine', function() { | |
return gulp.src('spec/test.js') | |
.pipe(jasmine()); | |
}); | |
gulp.task('test', ['start-server', 'jasmine'], function() { |
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
this.lunchHub = angular.module('lunchHub', []); | |
this.lunchHub.config([ | |
'$routeProvider', function($routeProvider) { | |
return $routeProvider.when('/addresses', { | |
templateUrl: '../templates/addresses/index.html', | |
controller: 'AddressIndexCtrl' | |
}).when('/groups', { | |
templateUrl: '../templates/groups/index.html', |
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 Appointment < ActiveRecord::Base | |
include ActionView::Helpers::NumberHelper | |
default_scope :order => "start_time asc" | |
scope :in_date_range, lambda { |start_date, end_date| self.in_date_range(start_date, end_date) } | |
scope :for_day, lambda { |date| in_date_range(date, date) } | |
scope :for_today, lambda { for_day(Time.zone.today) } | |
scope :for_tomorrow, lambda { for_day(Time.zone.today + 1.day) } | |
scope :not_time_blocks, joins(:time_block_type).where("code = 'APPOINTMENT'") | |
scope :checked_out, joins(:payments) |
NewerOlder