Skip to content

Instantly share code, notes, and snippets.

View guigs's full-sized avatar

Guilherme Goettems Schneider guigs

View GitHub Profile
@jeromedalbert
jeromedalbert / .gitattributes
Last active March 3, 2024 12:18
Automatically resolve Git merge conflicts in Rails schema.rb by picking the most recent date in the conflict (now works with Rails 5 and recent versions of Git). The following files should be in your home ~ directory. Inspired by https://tbaggery.com/2010/10/24/reduce-your-rails-schema-conflicts.html
db/schema.rb merge=railsschema

Commands examples

If the namespace is not used then the commands will perform on top of the default database. bundle exec rake db:create bundle exec rake db:migrate

By using the namespace we are going to use all the configuration for our alternate DB. bundle exec rake store:db:create bundle exec rake store:db:migrate

@tommarshall
tommarshall / simple_form.rb
Created August 22, 2013 14:58 — forked from clyfe/simple_form.rb
Bootstrap3 compatible simple_form initializer (with consistent Bootstrap 3 classes)
# http://stackoverflow.com/questions/14972253/simpleform-default-input-class
# https://github.com/plataformatec/simple_form/issues/316
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
@clyfe
clyfe / simple_form.rb
Created August 22, 2013 08:20
Bootstrap3 compatible simple_form initializer
# http://stackoverflow.com/questions/14972253/simpleform-default-input-class
# https://github.com/plataformatec/simple_form/issues/316
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
@mgreenly
mgreenly / gist:1109325
Created July 27, 2011 13:11
database cleaner multiple connections single orm outside of rails
RSpec.configure do |config|
config.before(:suite) do
ActiveRecord::Base.establish_connection database['one']
DatabaseCleaner.strategy = :deletion
ActiveRecord::Base.establish_connection config.database['two']
DatabaseCleaner.strategy = :deletion
end
config.before(:each) do
pt-BR:
errors:
messages:
expired: 'expirou, por favor solicite um novo'
not_found: 'não encontrado'
already_confirmed: 'já foi confirmado, por favor tente fazer login'
not_locked: 'não estava bloqueado'
not_saved:
one: "1 erro impediu que %{resource} fosse salvo:"
other: "%{count} erros impediram que %{resource} fosse salvo:"