Sha256: 50e02473db8e7d0cbed85bdee29855055bbf06994580d00dd8b660a7caff90aa

Contents?: true

Size: 459 Bytes

Versions: 1

Compression:

Stored size: 459 Bytes

Contents

class InvestingWishlist < ActiveRecord::Base

  self.table_name = "investing_wishlists"
  self.primary_key = 'id'

  has_one :wishlist, foreign_key: "id"
  has_many :investing_wishlist_types, :inverse_of => :investing_wishlist

  def show_details
    {
      id: self.id,
      name: self.name,
      timeframe: self.timeframe,
      investment_type_id: InvestingWishlistType.where(investing_wishlist_id: self.id).pluck(:investment_type_id)
    }
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
civic311_test3-0.0.2 app/models/investing_wishlist.rb