Sha256: 56ffff366c683587c9776669c6395cc5133066dec248985bdabf26234cb5094a

Contents?: true

Size: 236 Bytes

Versions: 11

Compression:

Stored size: 236 Bytes

Contents

module Spina
  module Partable
    def part(part)
      part = parts.where(name: part[:name]).first || parts.build(part)
      part.partable = part.partable_type.constantize.new unless part.partable.present?
      part
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spina-0.11.1 app/models/concerns/spina/partable.rb
spina-0.11.0 app/models/concerns/spina/partable.rb
spina-0.10.0 app/models/concerns/spina/partable.rb
spina-0.9.0 app/models/concerns/spina/partable.rb
spina-0.8.3 app/models/spina/partable.rb
spina-0.8.2 app/models/spina/partable.rb
spina-0.8.1 app/models/spina/partable.rb
spina-0.8.0 app/models/spina/partable.rb
spina-0.7.3 app/models/spina/partable.rb
spina-0.7.2 app/models/spina/partable.rb
spina-0.7.0 app/models/spina/partable.rb