base on guanxi.me
author: Francis Jiang
def smart_fetch(name, options, &blk)
options = HashWithIndifferentAccess.new(options)
require 'my-sinatra-app' | |
require 'sinatra/activerecord/rake' | |
desc "run irb console" | |
task :console, :environment do |t, args| | |
ENV['RACK_ENV'] = args[:environment] || 'development' | |
exec "irb -r irb/completion -r my-sinatra-app" | |
end |
To install dalli in your Rails 3 app, simply add the following to your Gemfile
and run bundle install.
# Gemfile
gem "dalli", "~> 2.6.4", :platforms => :ruby
To setup Rails to use the Dalli client for production, add the following to config/environments/production.rb:
ghost with heroku
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
heroku login
http://guides.rubyonrails.org/generators.html#creating-generators-with-generators
rails generate generator --help
rails generate generator setup_config
First, notice that we are inheriting from Rails::Generators::NamedBase
instead of Rails::Generators::Base
. This means that our generator expects at least one argument, which will be the name of the initializer, and will be available in our code in the variable name.
There can be several other reasons that fit your requirement for choosing the MyISAM engine. For example reads can be faster on MyISAM vs Innodb despite what the general claims on the above two links when MyISAM table has fixed (not dynamic) row size i.e. when it uses more CHARs for example versus VARCHARs. Still there could be other reasons besides this why you choose or have chosen MyISAM over Innodb. Another reason why you may have chosen MyISAM over Innodb is perhaps due to the fact that Innodb must perform additional checks owing to its ACID compliant nature - so for example a FK check needs to be checked which could potentially cause an operational overhead. Unless you ha