Sha256: 2b09e3fa786210c29f3bbbfd196ebb2a2748ec6512feb33729ce4f61162a2b66
Contents?: true
Size: 884 Bytes
Versions: 1
Compression:
Stored size: 884 Bytes
Contents
module Authgasm module Session # = ActiveRecord Trickery # # Authgasm looks like ActiveRecord, sounds like ActiveRecord, but its not ActiveRecord. That's the goal here. This is useful for the various rails helper methods such as form_for, error_messages_for, etc. # These helpers exptect various methods to be present. This adds in those methods into Authgasm. module ActiveRecordTrickery def self.included(klass) # :nodoc: klass.extend ClassMethods klass.send(:include, InstanceMethods) end module ClassMethods # :nodoc: def human_attribute_name(attribute_key_name, options = {}) attribute_key_name.humanize end end module InstanceMethods # :nodoc: def id nil end def new_record? true end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
authgasm-0.9.0 | lib/authgasm/session/active_record_trickery.rb |