Skip to content

Instantly share code, notes, and snippets.

Remember to set the parent model with all the attributes. There is no table for the sub models.
Ugh part one. From
http://code.alexreisner.com/articles/single-table-inheritance-in-rails.html
Overwrite the child models' model_name method:
def self.model_name
name = "vehical"
name.instance_eval do
def plural; pluralize; end
WTF
Spec::Mocks::MockExpectationError in 'SchemesController when I successfully POST 'create should create the scheme'
<TweetScheme(id: integer, user_id: integer, title: string, description: string, type: string, random_interval: boolean, frequency: integer, tweet_prompt: string, tweet_prompt_relationship: string, prompt: string, target: string, target_relationship: string, created_at: datetime, updated_at: datetime) (class)> received :new with unexpected arguments
expected: ([{"title"=>"scheme", "type"=>"TweetScheme", "description"=>"this is a scheme"}])
got: ([{"title"=>"scheme", "type"=>"TweetScheme", "description"=>"this is a scheme"}])
From total DNS control on godaddy.
3 A Records
Host- @
IPs- http://docs.heroku.com/custom-domains
CName
Host- www
Points to- proxy.heroku.com
matching last comma in a string with negative lookahead
,(?!.*,)
For some reason, neither of the following get the behavior I expected:
FileUtils.cp_r 'src/*', 'dest'
`cp -r src/* dest`
I need a period, not an asterisk.
From the docs:
FileUtils.cp_r 'src/.', 'dest'
# cp_r('src', 'dest') makes src/dest, but this doesn't.
Interesting...
~ $ irb
irb(main):001:0> test
ArgumentError: wrong number of arguments
from (irb):1:in `test'
from (irb):1
This is a project for tracking myself. The things I should do, don't do, wish I did, etc.
"Bugs" are things that I don't like that I aim to change. They can be given by anyone at "failin.gs" email, or submitted in person. (nailbiting and the like)
"Chores" are things that I need to do that don't add business value directly. (unimportant meetings, cleaning the gutters)
"Features" are things that do add business value, ie. things that I enjoy, improve my skills, and benefit my relationships with others.
There are two complications to using this project management system for this that I can predict now:
***lib/tasks/metrics***
begin
require 'metric_fu'
MetricFu::Configuration.run do |config|
config.metrics = [:flog]
config.flog = { :dirs_to_flog => ['app'] }
end
rescue LoadError
end
The rake tasks with Jeweler
rake -T
rake build # Build gem
rake check_dependencies # Check that runtime and development dependencies are installed
rake check_dependencies:development # Check that development dependencies are installed
rake check_dependencies:runtime # Check that runtime dependencies are installed
rake clobber_rdoc # Remove rdoc products
rake clobber_spec:rcov # Remove rcov products for spec:rcov
rake gemcutter:release # Release gem to Gemcutter
rake gemspec # Generate and validates gemspec
Problem:
pg_hba.conf:
local all all md5
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
pg_ident.conf:
(blank, just comments)