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
## Issue: | |
NameError in Admin/tweetsController#index | |
undefined local variable or method `tweets' for #<Class:0x7fcbe98f68f0> | |
Rails.root: /home/rails/ | |
Application Trace | Framework Trace | Full Trace | |
app/models/tweet.rb:23:in `add_tweets' | |
app/models/tweet.rb:15:in `update_twitter_account' | |
app/models/tweet.rb:9:in `update_tweets' |
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
io@love:~/rails/m3$ git branch -a | |
admin | |
authlogic | |
inlineadmin | |
list | |
* master | |
remotes/origin/add_devise | |
remotes/origin/admin | |
remotes/origin/authlogic | |
remotes/origin/master |
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
Padrino.after_load do | |
require 'will_paginate/view_helpers/base' | |
require 'will_paginate/view_helpers/link_renderer' | |
require 'will_paginate/finders/active_record' | |
WillPaginate::Finders::ActiveRecord.enable! | |
end |
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
array_of_hashes = ModelOneAddress.all + ModelTwoAddress.all | |
array_of_hashes.sort_by { |hsh| hsh[:zip] } |
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
## The setup | |
# This assumes you already have friendly_id in your gemfile and all that good stuff. | |
class Car < ActiveRecord::Base | |
# Slugs via FriendlyId | |
extend FriendlyId | |
friendly_id :name, :use => :scoped, :scope => :type | |
end | |
class Ford < Car | |
end |
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
mario@red demo $ git clone https://github.com/maxlapshin/mysql2postgres.git | |
Cloning into mysql2postgres... | |
cd myremote: Counting objects: 516, done. | |
remote: Compressing objects: 100% (269/269), done. | |
remote: Total 516 (delta 262), reused 486 (delta 237) | |
Receiving objects: 100% (516/516), 84.68 KiB, done. | |
Resolving deltas: 100% (262/262), done. | |
mario@red demo $ cd mysql2postgres/ | |
# Optional: I use RVM and wanted to use ruby 1.9.2 | |
mario@red mysql2postgres $ rvm ruby-1.9.2-p290 |
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
# No Config File | |
mario@red mysql2postgres $ ls -la | grep yml | |
mario@red mysql2postgres $ mysql2psql | |
/Users/mario/.rvm/gems/ruby-1.9.2-p290/gems/mysql2psql-0.1.0/lib/mysql2psql/config.rb:14:in `initialize': (Mysql2psql::ConfigurationFileInitialized) | |
No configuration file found. | |
A new file has been initialized at: /Users/mario/ruby/demo/mysql2postgres/mysql2psql.yml | |
Please review the configuration and retry.. | |
# Aw yeah, there she is |
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
mario@red mysql2postgres $ mysql2psql | |
Table creation 0 min, loading 7 min, indexing 0 min, total 7 min |
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
mario@red mysql2postgres $ mysql2psql | |
Assertion failed: (param->buffer_length != 0), function setup_one_fetch_function, file /tmp/homebrew-mysql-connector-c-6.0.2-SKcq/mysql-connector-c-6.0.2/libmysql/libmysql.c, line 3985. | |
Abort trap |
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
posts = Post.all | |
Parallel.each(posts, :in_processes => 10) do |post| | |
post.title = post.title.downcase | |
post.save! | |
end | |
# Goes with | |
# http://ruby.zigzo.com/2012/01/29/the-parallel-gem-and-postgresql-oh-and-rails/ |
OlderNewer