- The first
model
argument is the model class - The second argument
find_or_create_by
is a hash of attributes that are used for finding a record. If the record doesn't exist, it will be created. This hash is like the unique identifier of a seed record. - The third argument
update_with
is a hash of attributes that will be always set on the record, whether the record already exists or has to be created. This is useful when the seeds are extended and you want to update existing records with new attributes.
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
2.5.0 |
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
# File: spec/models/base_spec.rb | |
require 'rails_helper' | |
RSpec.describe 'All ActiveRecord::Base models' do | |
context 'has_many with :dependent key' do | |
each_active_record_model do |model| | |
has_many_relations(model).each do |has_many_relation| | |
it "has :dependent defined on the #{model}##{has_many_relation.name} relation" do | |
expect(has_many_relation.options[:dependent]).not_to be_nil |
I hereby claim:
- I am koffeinfrei on github.
- I am koffeinfrei (https://keybase.io/koffeinfrei) on keybase.
- I have a public key whose fingerprint is 26F1 300F 4F40 F679 66F0 A62D B0B7 DE56 128A 5B8F
To claim this, I am signing this object:
Moved to https://github.com/metaflop/metaflop-www/wiki/Contribute-a-MF-to-Metaflop
This is a rough draft, work in progress
The structure is planned to change, but for now this is how a metaflop font should look like to be compatible with metaflop.
- Create the required files structure, have a look at e.g. https://github.com/metaflop/metaflop-font-bespoke and https://github.com/metaflop/metaflop-font-fetamont.
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
#!/bin/sh | |
# Help output | |
help() { | |
echo "Usage: git-fame [options] <repository_path>" | |
echo " -m Machine readable output" | |
echo " -h Print this help" | |
exit 1 | |
} |
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
.bundle/ |
- Setup new horse twitter account
- Create a new Twitter account that you'd like to have your auto-tweets posted to
- Go to dev.twitter.com, create a new application with Read+Write permissions
- Create an access token + secret for the account and copy that and the consumer key and secrets.
- Get your twitter archive
- Go to Twitter.com -> Settings -> Download Archive.
- The tweets.csv file is in the top directory. Put it in the same directory as this script.
NewerOlder