Skip to content

Instantly share code, notes, and snippets.

View cmar's full-sized avatar

Chris Mar cmar

  • CustomInk
  • Northern, VA
  • X @cmar
View GitHub Profile
@cmar
cmar / spree_template.rb
Created November 1, 2011 13:07
Spree Template
gem 'spree'
gem "rspec-rails", :group => [ :development, :test ]
gem "factory_girl_rails", :group => [:test]
run 'bundle install'
remove_dir 'test'
generate 'rspec:install'
create_file 'spec/factories.rb' do
%q{FactoryGirl.define do
factory :user do
@cmar
cmar / site.rb
Created October 26, 2011 13:44
URL Validation
validates :url, :presence => true,
:format => { :with => URI::regexp(%w(http https)) },
:uniqueness => true
@cmar
cmar / base_template.rb
Created October 8, 2011 13:50
Base Rails Template
gem 'devise'
gem "rspec-rails", :group => [ :development, :test ]
gem "factory_girl_rails", :group => [:test]
run 'bundle install'
generate "devise:install"
generate "devise", "User"
rake "db:migrate", :env => 'development'
rake "db:migrate", :env => 'test'
Processing by Admin::ConfigurationsController#index as HTML
SpreeMultiStoreConfiguration Load (0.2ms) SELECT "configurations".* FROM "configurations" WHERE "configurations"."type" IN ('SpreeMultiStoreConfiguration') AND "configurations"."name" = 'Default spree_multi_store configuration' LIMIT 1
CACHE (0.0ms) SELECT "configurations".* FROM "configurations" WHERE "configurations"."type" IN ('SpreeMultiStoreConfiguration') AND "configurations"."name" = 'Default spree_multi_store configuration' LIMIT 1
Store Load (0.2ms) SELECT "stores".* FROM "stores" WHERE (subdomain = 'store1') LIMIT 1
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1057526567 LIMIT 1
Role Load (0.1ms) SELECT "roles".* FROM "roles" INNER JOIN "roles_users" ON "roles"."id" = "roles_users"."role_id" WHERE "roles_users"."user_id" = 1057526567
Property Load (0.1ms) SELECT "properties".* FROM "properties" WHERE "properties"."name" = 'brand' LIMIT 1
Rendered /Users/cmar/.rvm/gems/ruby-1.8.7-p352/bundler/gems/sp