Skip to content

Instantly share code, notes, and snippets.

View joxxoxo's full-sized avatar

Andrei Razhkouski joxxoxo

View GitHub Profile
@bradtraversy
bradtraversy / mongodb_cheat_sheet.md
Last active November 17, 2024 10:01
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@joxxoxo
joxxoxo / seeds.rb
Created March 22, 2013 15:05
to bypass mass-assignment in seeds
# to bypass mass-assignment
Dir[Rails.root.join('app/models/*')].each {|f| require_dependency f }
ActiveRecord::Base.descendants.each {|m| p m.name; m.attr_accessible(*m.attribute_names)}