Skip to content

Instantly share code, notes, and snippets.

username password authData emailVerified admin avatar company coolrProfile coverPhoto email facebookProfile firstName followingTeams lastAdminReminder lastName linkedInProfile linkedinId locationName lowercaseName mobilePhone phoneNumber profileUrl receivesPush skype tags team title userStats waadProfile workEmail workPhone
# uber-hacky dynamic collection names for MongoID models:
#
# class MyModel
# include Mongoid::PrefixableDocument # ...instead of Mongoid::Document
# include Mongoid::Timestamps
#
# field :foobar, :type => Integer
#
# def my_method; 123; end
#
@jygeer
jygeer / gist:1175499
Created August 27, 2011 15:18
MongoMapper patch for Paperclip
# this fixes a bug in MongoMapper/Paperclip in rails 3.1 https://github.com/jnunemaker/mongomapper/issues/293
# config/initializers/mongo.rb
module MongoMapper
module Plugins
module EmbeddedCallbacks
module InstanceMethods
def run_callbacks(callback, opts = nil, &block)
embedded_docs = []
# Rails 3 - support for cookie across all subdomains and top level domain
# config/initializers/session_store.rb
Rails.application.config.session_store :cookie_store, :key => '_session_cookie', :domain => :all