Skip to content

Instantly share code, notes, and snippets.

@dmoulton
dmoulton / HstoreModel.rb
Created June 12, 2012 19:39 — forked from kfatehi/HstoreModel.rb
Hstore ActiveRecord::Base method_missing
## Hstore Method Missing Extension
module HstoreModel
def method_missing(method, *args, &block)
key = method.to_s.gsub('=','').to_sym
sym_options = options.symbolize_keys
if !self.class.attribute_methods_generated?
self.class.define_attribute_methods
if respond_to_without_attributes?(method)
send(method, *args, &block)