Skip to content

Instantly share code, notes, and snippets.

View aliuk2012's full-sized avatar
🏬
Nurse! Rebase! Rebase! Sh*t, we’re losing it. Squash commit. Squash commit.

Alistair Laing aliuk2012

🏬
Nurse! Rebase! Rebase! Sh*t, we’re losing it. Squash commit. Squash commit.
  • Chesterfield and London
View GitHub Profile

Keybase proof

I hereby claim:

  • I am aliuk2012 on github.
  • I am aliuk (https://keybase.io/aliuk) on keybase.
  • I have a public key ASDwjsrwrg-44KZM_HYy_pqieYGCL1E7w_DU1FiTKT_t0wo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am aliuk2012 on github.
  • I am aliuk (https://keybase.io/aliuk) on keybase.
  • I have a public key whose fingerprint is 6C28 6AC7 80B7 27C5 BC92 0855 DA0B DC46 9D8C 0538

To claim this, I am signing this object:

class DocAttachment < ActiveRecord::Base
belongs_to :doc_attachment_type
belongs_to :language
acts_as_gov_uk_date :published_date
has_attached_file :attachment
after_attachment_post_process :rename_file
@aliuk2012
aliuk2012 / error
Last active November 29, 2015 21:45
1) Failure:
ExpenseTypesControllerTest#test_should_update_expense_type [/Users/alaing/personal-dev/my-dosh/test/controllers/expense_types_controller_test.rb:53]:
Expected response to be a <redirect>, but was <200>
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
monthly:
name: Monthly
in_use: true
duration: 1
quarterly:
name: Quarterly
in_use: true
--color
--require spec_helper
--format doc
@aliuk2012
aliuk2012 / user.rb
Created August 12, 2014 08:36
Not Validating correctly
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
validates :first_name, presence: true
validates :last_name, presence: true
validates :profile_name, presence: true,
uniqueness: true,
@aliuk2012
aliuk2012 / new.html.erb
Created August 10, 2014 21:23
Trouble adding values to new fields on insert
<h2>Sign up</h2>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :first_name %><br />
<%= f.text_field :first_name %></div>
<div><%= f.label :last_name %><br />
<%= f.text_field :last_name %></div>
@aliuk2012
aliuk2012 / rails-server-output
Last active August 29, 2015 14:02
rails server output
C:\Users\thelaings\ruby-sites\simple_cms>rails server
C:/Ruby200-x64/lib/ruby/gems/2.0.0/extensions/x64-mingw32/2.0.0/mysql2-0.3.16/my
sql2/mysql2.so: [BUG] Segmentation fault
ruby 2.0.0p481 (2014-05-08) [x64-mingw32]
-- Control frame information -----------------------------------------------
c:0020 p:-10237160 s:0067 e:000066 TOP [FINISH]
c:0019 p:---- s:0065 e:000064 CFUNC :require
c:0018 p:0083 s:0061 e:000060 TOP C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mys
ql2-0.3.16/lib/mysql2.rb:8 [FINISH]
@aliuk2012
aliuk2012 / Gruntfile
Created September 27, 2013 18:35
First Gruntfile.js example
module.exports = function(grunt){
"use strict";
grunt.initConfig({
sass: { // Task
dist: { // Target
options: { // Target options
style: 'expanded'
},
files: { // Dictionary of files
'main.css': 'main.scss', // 'destination': 'source'