NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
If you have your code defined in classes in lib/ folder you may have problems to load that code in production.
Autoloading is disabled in the production environment by default because of thread safety.
Change config/application.rb:
config.autoload_paths << Rails.root.join("lib")
config.eager_load_paths << Rails.root.join("lib")
http://guides.rubyonrails.org/migrations.html
brew install fish
curl -L https://get.oh-my.fish | fish| require 'active_record' | |
| require 'arel' | |
| # Ruby-like syntax in AR conditions using the underlying Arel layer (Rails >= 3.0). | |
| # | |
| # What you would usually write like this: | |
| # | |
| # User.where(["users.created_at > ? AND users.name LIKE ?", Date.yesterday, "Mary"]) | |
| # | |
| # can now be written like this (note those parentheses required by the operators precedences): |
| class Person | |
| def name(n) | |
| @name = n | |
| self | |
| end | |
| def age(a) | |
| @age = a | |
| self | |
| end |
| # Info/code for this file were borrowed from the following places: | |
| # http://bit.ly/174dkWL | |
| # https://gist.github.com/adamcrown/932231 | |
| # https://gist.github.com/patmcnally/893833 | |
| begin | |
| # ansi colors | |
| ANSI = {} | |
| ANSI[:RESET] = "\e[0m" |