Skip to content

Instantly share code, notes, and snippets.

View aaronsama's full-sized avatar

Aaron Ciaghi aaronsama

  • New Work SE
  • Barcelona, Spain
View GitHub Profile
@aaronsama
aaronsama / all_to_bigint.rb
Last active January 24, 2018 10:04
Migrates all your IDs to bigint. Useful when migrating from Rails < 5.1 to Rails 5.1+
class AllToBigint < ActiveRecord::Migration[5.1]
def up
switch_all_to(__method__, :bigint)
end
def down
switch_all_to(__method__, :integer)
end
private
@aaronsama
aaronsama / simple_form_mdl_wrappers.rb
Created February 23, 2016 17:59 — forked from anonymous/simple_form_mdl_wrappers.rb
Material Design Lite wrappers for Simple Form
# Simple wrappers for Material Design Lite text fields to use with SimpleForm (Rails)
SimpleForm.setup do |config|
config.wrappers :mdl_field, tag: 'div', class: 'mdl-textfield mdl-js-textfield', error_class: 'mdl-textfield__error' do |b|
b.use :html5
b.use :input, class: 'mdl-textfield__input'
b.use :label, class: 'mdl-textfield__label'
end
@aaronsama
aaronsama / README.md
Last active June 15, 2016 17:03
Star rating