Skip to content

Instantly share code, notes, and snippets.

@flada-auxv
Forked from CodeIQ/concern.rb
Created December 19, 2012 10:22

Revisions

  1. @grooves-bot grooves-bot created this gist Dec 4, 2012.
    4 changes: 4 additions & 0 deletions concern.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    # coding: utf-8
    class Concern < ActiveRecord::Base
    belongs_to :publication
    end
    3 changes: 3 additions & 0 deletions index.html.haml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    - @publications.each do |pub|
    = pub.concerns.count
    = pub.publication_comments.count
    5 changes: 5 additions & 0 deletions publication.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # coding: utf-8
    class Publication < ActiveRecord::Base
    has_many :concerns
    has_many :publication_comments
    end
    4 changes: 4 additions & 0 deletions publication_comment.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    # coding: utf-8
    class PublicationComment < ActiveRecord::Base
    belongs_to :publication
    end
    6 changes: 6 additions & 0 deletions publications_controller.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    # coding: utf-8
    class PublicationsController < ApplicationController
    def index
    @publications = Publication.all
    end
    end