Sha256: 24040c90136d890e5b3864d668a3a8ce5dd3b4b1e2e646283f562976c0b8939e

Contents?: true

Size: 877 Bytes

Versions: 17

Compression:

Stored size: 877 Bytes

Contents

module ActiveRecord
  module Has #:nodoc:
    module MuckProfile #:nodoc:
      def self.included(base)
        base.extend(ClassMethods)
      end

      module ClassMethods

        def has_muck_profile
          
          has_one :profile, :dependent => :destroy
          accepts_nested_attributes_for :profile, :allow_destroy => true 
          after_create {|user| user.create_profile() unless user.profile}
          delegate :photo, :to => :profile
           
          include ActiveRecord::Has::MuckProfile::InstanceMethods
          extend ActiveRecord::Has::MuckProfile::SingletonMethods
        end

      end

      # class methods
      module SingletonMethods
  
      end

      # All the methods available to a record that has had <tt>acts_as_muck_profile</tt> specified.
      module InstanceMethods
        
        
        
      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
muck-profiles-0.1.16 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.15 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.14 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.13 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.12 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.11 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.10 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.7 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.8 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.9 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.0 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.1 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.2 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.3 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.4 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.5 lib/active_record/has/muck_profile.rb
muck-profiles-0.1.6 lib/active_record/has/muck_profile.rb