Sha256: 65ba3f33fdc4dd3a0b0f19975161ce999dd31aee543277be2d0cd146704ce604

Contents?: true

Size: 491 Bytes

Versions: 1

Compression:

Stored size: 491 Bytes

Contents

module RailsClafer
  class Association
    class << self
      def from_ar_assoc(src_class, ar_assoc)
        card = Card.from_ar_assoc ar_assoc
        assoc = new ClaferModel.claferize_name(src_class.name), ClaferModel.claferize_name(ar_assoc.klass.name), card
        assoc.ref_name = ar_assoc.name
        assoc
      end
    end
    attr_accessor :src, :dst, :dst_card, :ref_name
    def initialize(src, dst, dst_card)
      @src, @dst, @dst_card = src, dst, dst_card
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_clafer-0.1.3 lib/rails_clafer/association.rb