Sha256: 8d300c650ea86038452cf0095002fe679002b5e8be9ea33580d9a41d8e92bde2
Contents?: true
Size: 562 Bytes
Versions: 30
Compression:
Stored size: 562 Bytes
Contents
module ActiveResource::Associations::Builder class BelongsTo < Association self.valid_options += [:foreign_key, :embed] self.macro = :belongs_to def build validate_options embed = options.delete(:embed) reflection = model.create_reflection(self.class.macro, name, options) model.defines_belongs_to_finder_method(reflection.name, reflection.klass, reflection.foreign_key) model.defines_belongs_to_embed(reflection.name, reflection.klass, reflection.foreign_key) if embed return reflection end end end
Version data entries
30 entries across 30 versions & 1 rubygems