Module: Yt::Associations

Extended by:
ActiveSupport::Autoload
Included in:
Models::Base
Defined in:
lib/yt/associations.rb,
lib/yt/associations/ids.rb,
lib/yt/associations/views.rb,
lib/yt/associations/videos.rb,
lib/yt/associations/ratings.rb,
lib/yt/associations/channels.rb,
lib/yt/associations/earnings.rb,
lib/yt/associations/snippets.rb,
lib/yt/associations/statuses.rb,
lib/yt/associations/playlists.rb,
lib/yt/associations/user_infos.rb,
lib/yt/associations/annotations.rb,
lib/yt/associations/details_sets.rb,
lib/yt/associations/subscriptions.rb,
lib/yt/associations/playlist_items.rb,
lib/yt/associations/authentications.rb,
lib/yt/associations/partnered_channels.rb

Defined Under Namespace

Modules: Annotations, Authentications, Channels, DetailsSets, Earnings, Ids, PartneredChannels, PlaylistItems, Playlists, Ratings, Snippets, Statuses, Subscriptions, UserInfos, Videos, Views

Instance Method Summary collapse

Instance Method Details

#has_many(attributes, options = {}) ⇒ Object Also known as: has_one



30
31
32
33
34
# File 'lib/yt/associations.rb', line 30

def has_many(attributes, options = {})
  mod = attributes.to_s.sub(/.*\./, '').camelize
  include "Yt::Associations::#{mod.pluralize}".constantize
  delegate *options[:delegate], to: attributes if options[:delegate]
end