Sha256: ae3cfb82728322f956c8d0fa60cec9a4f4b07b650d13b4a6d5b64b836e640d2f

Contents?: true

Size: 417 Bytes

Versions: 2

Compression:

Stored size: 417 Bytes

Contents

module Arrest
  class BelongsToAttribute < Attribute
    attr_accessor :foreign_key

    def initialize(name, actions, field_class_name, foreign_key, target_class_name)
      super(name, field_class_name, actions)
      @foreign_key = foreign_key
      @target_class_name = target_class_name
    end

    def target_class
      @target_class ||= Arrest::Source.class_loader.load(@target_class_name)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
arrest-0.0.91 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.90 lib/arrest/attributes/belongs_to_attribute.rb