Sha256: d4eda3b307adf36f4612a92c7b2d0383198d7c6c3058088f8a792d62fcdf3459

Contents?: true

Size: 408 Bytes

Versions: 3

Compression:

Stored size: 408 Bytes

Contents

class User < ActiveRecord::Base
  attr_accessible :name
  has_many :posts
  has_many :likes

  include MyFeeds::Feeder
  include MyFeeds::Eater

  define_feed_event :write_post, target_type: Post.to_s
  define_feed_event :write_some_code

  def post title, content
    post = self.posts.create title: title, content: content
    write_post target_id: post.id
  end

  def feeds
    feeds_for likes
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
my_feeds-1.0.0 spec/models/user.rb
my_feeds-0.1.1 spec/models/user.rb
my_feeds-0.1.0 spec/models/user.rb