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
require 'spec_helper' | |
describe "Artists to releases relationship" do | |
before(:all) do | |
@kanye = FactoryGirl.create(:artist, :name => 'Kanye West') | |
@jz = FactoryGirl.create(:artist, :name => 'Jay Z') | |
@watch_the_throne = FactoryGirl.create(:release, :name => 'Watch the Throne') | |
@dropout = FactoryGirl.create(:release, :name => 'The College Dropout') | |
end |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> TyC SPOTS</title> | |
<meta charset="utf-8" /> | |
</head> | |
<body bgcolor="#426669"> | |
<h1 style="text-align:center; colour: blue;">TyC SPORTS</h1> |
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
puts "**** Please enter the desired email for the Administrator ****" | |
email = STDIN.gets.chomp | |
puts "**** Please enter the desired password for the Administrator ****" | |
password = STDIN.gets.chomp | |
admin = Admin.new(:email => email, :password => password) | |
if admin.save |
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
= form_for @certificate | |
- if @certificate.errors.any? | |
ul.error-list | |
- @certificate.errrors.each do |error| | |
li.error-item #{error} | |
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
require 'vacuum' | |
class AmazonSync | |
def test | |
@request = Vacuum.new | |
@request.configure( | |
aws_access_key_id: ENV['AMAZON_ACCESS_KEY'], | |
aws_secret_access_key: ENV['AMAZON_SECRET_ACCESS_KEY'], | |
associate_tag: ENV['AMAZON_ASSOCIATE_TAG'] | |
) | |
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
def confirmation_email(user) | |
@user = user | |
@token = user.confirmation_token | |
mail(to: @user.email, subject: 'Please confirm your account') | |
end |
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
<ul class="social"> | |
<li><a href="#" class="fb">Facebook</a></li> | |
<li><a href="#" class="tw">Twitter</a></li> | |
<li><a href="#" class="google">Google+</a></li> | |
<li><a href="#" class="insta">Instagram</a></li> | |
<li><a href="#" class="skype">Skype</a></li> | |
<li><a href="#" class="vimeo">Vimeo</a></li> | |
</ul> |
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
jQuery -> | |
$('body').prepend('<div id="fb-root"></div>') | |
$.ajax | |
url: "#{window.location.protocol}//connect.facebook.net/en_US/all.js" | |
dataType: 'script' | |
cache: true | |
window.fbAsyncInit = -> |
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 DeviseSessionsController < Devise::SessionsController | |
clear_respond_to | |
respond_to :json | |
end |
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
Product | |
has_many reviews | |
... | |
positives = Product.includes(:reviews).select("COUNT(reviews.rating) AS cta").having("cta > 3") | |
... | |
def self.positves | |
includes(:reviews).select("id", "COUNT(reviews.rating) AS cta").having("cta > 3") | |
end | |
... | |
Product.where(:id.nin => positives.pluck(:id)) |
OlderNewer