Sha256: 53bebc4cf24c0d43db2c544364d0a8fbab47072b2fe1feec3f18914b35d1e9d8

Contents?: true

Size: 386 Bytes

Versions: 55

Compression:

Stored size: 386 Bytes

Contents

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

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
arrest-0.0.75 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.74 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.73 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.72 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.71 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.70 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.69 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.68 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.67 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.66 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.65 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.64 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.63 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.62 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.61 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.60 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.59 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.58 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.57 lib/arrest/attributes/belongs_to_attribute.rb
arrest-0.0.56 lib/arrest/attributes/belongs_to_attribute.rb