Sha256: 05a1905778463a108f2907d02b4d9cf20da82d19a75233f3294bc0a9b9b9327f

Contents?: true

Size: 401 Bytes

Versions: 7

Compression:

Stored size: 401 Bytes

Contents

module Arrest
  class BelongsToAttribute < Attribute
    attr_accessor :foreign_key
    def initialize(name, actions, field_class, foreign_key, target_class_name)
      super(name, field_class, actions)
      @foreign_key = foreign_key
      @target_class_name = target_class_name
    end
    def target_class
      @target_class ||= Arrest::Source.mod.const_get(@target_class_name)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
arrest-0.0.89 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.88 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.87 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.86 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.85 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.84 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.83.crud lib/arrest/attributes/belongs_to_attribute.rb