Created
July 22, 2013 16:07
-
-
Save skinnyjames/6055085 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
#commit models | |
class Commit < ActiveRecord::Base | |
attr_accessible :commit_url, :author, :commit_message | |
set_inheritance_column :provider | |
end | |
class GithubCommit < Commit | |
end | |
#story model | |
class Story < ActiveRecord::Base | |
has_many :notes | |
has_many :commits | |
def activities | |
notes.zip(commits) | |
end | |
end | |
#view | |
<% story.activities.each do |activity| %> | |
<%= render :partial => "#{activity.class}" %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment