Skip to content

Instantly share code, notes, and snippets.

DEPRECATION WARNING: Rake tasks in vendor/plugins/annotate_models/tasks are deprecated. Use lib/tasks instead. (called from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/tasks/rails.rb:10)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant Cms::AttachmentsController
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:440:in `load_missing_constant'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in `const_missing'
/usr/local/lib/ruby/gems/1.8/gems/bcms_s3-0.2.1/lib/bcms_s3/s3_module.rb:140
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
@mezza
mezza / i18n_debug.rb
Created June 23, 2022 15:19
Extract all expanded i18n keys and values
# Execute following in rails console after invoking i18n.t() on a known key to load the translations
def flatten_hash(hash)
hash.each_with_object({}) do |(k, v), h|
if v.is_a? Hash
flatten_hash(v).map do |h_k, h_v|
h["#{k}.#{h_k}".to_sym] = h_v
end
else
h[k] = v