Sha256: 0e38fb5ddf6ea4153ecea5f5aae95e8ebc964ec518490c6fd3b6199fedbb388e

Contents?: true

Size: 691 Bytes

Versions: 14

Compression:

Stored size: 691 Bytes

Contents

module ErpBaseErpSvcs
	module Extensions
		module ActiveRecord
			module HasNotes
				def self.included(base)
				  base.extend(ClassMethods)
				end

				module ClassMethods
				  def has_notes

            has_many :notes, :as => :noted_record, :dependent => :delete_all do
              def by_type(note_type)
                find_by_note_type_id(note_type.id)
              end
            end
					
            extend ErpBaseErpSvcs::Extensions::ActiveRecord::HasNotes
            include ErpBaseErpSvcs::Extensions::ActiveRecord::HasNotes

				  end
				end

				module SingletonMethods
				end

				module InstanceMethods
				end
			end
		end
	end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
erp_base_erp_svcs-3.1.5 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb
erp_base_erp_svcs-3.1.4 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb
erp_base_erp_svcs-3.1.3 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb
erp_base_erp_svcs-3.1.2 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb
erp_base_erp_svcs-3.1.1 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb
erp_base_erp_svcs-3.0.7 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb
erp_base_erp_svcs-3.1.0 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb
erp_base_erp_svcs-3.0.6 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb
erp_base_erp_svcs-3.0.5 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb
erp_base_erp_svcs-3.0.4 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb
erp_base_erp_svcs-3.0.3 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb
erp_base_erp_svcs-3.0.2 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb
erp_base_erp_svcs-3.0.1 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb
erp_base_erp_svcs-3.0.0 lib/erp_base_erp_svcs/extensions/active_record/has_notes.rb