loaded on production: Don't put it somewhere under lib. For more info see this . # config/application.rb config.paths.add 'extras', eager_load: true Arkency post
mailers, models, views, etc. # From this default: config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*.{rb,yml}' # to using a recursive directory glob: config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,
to .gitignore, then update bin/setup: # uncomment these lines in bin/setup puts "\n== Copying sample files ==" unless File.exist?('config/database.yml') cp 'config/database.yml.sample', 'config/database.yml' end
Delete all your other migrations, rake db:migrate:reset class CollapseMigrations < ActiveRecord::Migration def up # schema.rb's ActiveRecord::Schema.define() block end def down raise ActiveRecord::IrreversibleMigration end end
Savchenko @robotector class WrappingForm include ActiveModel::Model def initialize(model) @model = model end attr_reader :model end class UpdateProfileForm < WrappingForm delegate :first_name, :last_name, to: :model validates :first_name, :last_name, presence: true end
a remote rake task, example: "cap staging remote:rake[db:version]"' task :rake, [:task] do |t, args| on primary fetch(:migration_role) do within release_path do with rails_env: fetch(:rails_env) do execute :rake, args.task end end end end desc 'Run a remote command, example: "cap production remote:cmd[ps,aux]"' task :cmd, [:cmd, :options] do |t,args| on primary fetch(:migration_role) do