Sha256: 090b82459a12b2c25de87f4451f80434b7eeda01b25d2dfd93dfa0ebb3c72561

Contents?: true

Size: 278 Bytes

Versions: 55

Compression:

Stored size: 278 Bytes

Contents

module HasAccounts
  module ClassMethods
    def has_accounts(options = {})
      class_eval <<-end_eval
        has_many :accounts, :as => 'holder'
        has_one :account, :as => 'holder'
      end_eval
    end
  end
end

ActiveRecord::Base.extend(HasAccounts::ClassMethods)

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
has_accounts-2.0.3 lib/has_accounts/class_methods.rb
has_accounts-2.0.2 lib/has_accounts/class_methods.rb
has_accounts-2.0.1 lib/has_accounts/class_methods.rb
has_accounts-2.0.0 lib/has_accounts/class_methods.rb
has_accounts-1.1.3 lib/has_accounts/class_methods.rb
has_accounts-1.1.2 lib/has_accounts/class_methods.rb
has_accounts-1.1.1 lib/has_accounts/class_methods.rb
has_accounts-1.0.2 lib/has_accounts/class_methods.rb
has_accounts-1.0.1 lib/has_accounts/class_methods.rb
has_accounts-1.0.0 lib/has_accounts/class_methods.rb
has_accounts-0.20.1 lib/has_accounts/class_methods.rb
has_accounts-0.20.0 lib/has_accounts/class_methods.rb
has_accounts-0.19.1 lib/has_accounts/class_methods.rb
has_accounts-0.19.0 lib/has_accounts/class_methods.rb
has_accounts-0.18.4 lib/has_accounts/class_methods.rb
has_accounts-0.18.3 lib/has_accounts/class_methods.rb
has_accounts-0.18.2 lib/has_accounts/class_methods.rb
has_accounts-0.18.1 lib/has_accounts/class_methods.rb
has_accounts-0.18.0 lib/has_accounts/class_methods.rb
has_accounts-0.17.5 lib/has_accounts/class_methods.rb