Sha256: 5fe9dcd946f22613a0063661904934441dae72ce31535632290c9bad9074d653

Contents?: true

Size: 465 Bytes

Versions: 19

Compression:

Stored size: 465 Bytes

Contents

require 'disposable/twin'

module Cell
  module Twin
    def self.included(base)
      base.send :include, Disposable::Twin::Builder
      base.extend ClassMethods
    end

    module ClassMethods
      def twin(twin_class)
        super(twin_class) { |dfn| property dfn.name } # create readers to twin model.
      end
    end

    def initialize(model, options={})
      super(build_twin(model, options), controller: options.delete(:controller))
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
cells-4.1.8 lib/cell/twin.rb
cells-4.1.7 lib/cell/twin.rb
cells-4.1.6 lib/cell/twin.rb
cells-4.1.5 lib/cell/twin.rb
cells-4.1.4 lib/cell/twin.rb
cells-4.1.3 lib/cell/twin.rb
cells-4.1.2 lib/cell/twin.rb
cells-4.1.1 lib/cell/twin.rb
cells-4.1.0 lib/cell/twin.rb
cells-4.1.0.rc1 lib/cell/twin.rb
cells-4.0.5 lib/cell/twin.rb
cells-4.0.4 lib/cell/twin.rb
cells-4.0.3 lib/cell/twin.rb
cells-4.0.2 lib/cell/twin.rb
cells-4.0.1 lib/cell/twin.rb
cells-4.0.0 lib/cell/twin.rb
cells-4.0.0.rc1 lib/cell/twin.rb
cells-4.0.0.beta6 lib/cell/twin.rb
cells-4.0.0.beta5 lib/cell/twin.rb