Skip to content

Instantly share code, notes, and snippets.

@grooves
grooves / concern.rb
Created December 4, 2012 05:19
Question 1
# coding: utf-8
class Concern < ActiveRecord::Base
belongs_to :publication
end
@grooves
grooves / activity.rb
Created December 4, 2012 05:25
Question 2
# coding: utf-8
class Activity < ActiveRecord::Base
belongs_to :target, polymorphic: true
def message
# return something
end
end
@grooves
grooves / company_user.rb
Created December 4, 2012 05:29
Question 3
# coding: utf-8
class CompanyUser < ActiveRecord::Base
attr_accessible :user_id, :company_id, :position
attr_accessible :user_id, :company_id, :position, :is_admin, as: :admin
end