-
-
Save hardbap/388474 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Post < ActiveRecord::Base | |
has_many :authors | |
attr_accessor :post_authors_cache | |
def post_authors_cache | |
@post_authors_cache ||= process_post_authors | |
end | |
private | |
def process_post_authors | |
#do some crazy stuff here and set the post_authors_cache | |
#some crazy hash of stuff based on some inane business logic | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment