Sha256: c49a4f749707a681bd6c0ac2a36a961a18151bb9d8d19fcca7c2df16f97a958d

Contents?: true

Size: 847 Bytes

Versions: 12

Compression:

Stored size: 847 Bytes

Contents

module Authlogic
  module Session
    # = ActiveRecord Trickery
    #
    # Authlogic 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 Authlogic.
    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 new_record?
          new_session?
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
authlogic-0.10.4 lib/authlogic/session/active_record_trickery.rb
authlogic-1.0.0 lib/authlogic/session/active_record_trickery.rb
authlogic-1.2.0 lib/authlogic/session/active_record_trickery.rb
authlogic-1.2.1 lib/authlogic/session/active_record_trickery.rb
authlogic-1.2.2 lib/authlogic/session/active_record_trickery.rb
authlogic-1.3.1 lib/authlogic/session/active_record_trickery.rb
authlogic-1.1.0 lib/authlogic/session/active_record_trickery.rb
authlogic-1.1.2 lib/authlogic/session/active_record_trickery.rb
authlogic-1.3.0 lib/authlogic/session/active_record_trickery.rb
authlogic-1.3.2 lib/authlogic/session/active_record_trickery.rb
authlogic-1.1.1 lib/authlogic/session/active_record_trickery.rb
authlogic-1.3.3 lib/authlogic/session/active_record_trickery.rb