Skip to content

Instantly share code, notes, and snippets.

module HasRelations
module ClassMethods
def has_relations
include InstanceMethods
has_many :relations, :as => :from
end
end
module InstanceMethods
def related(relation_type = nil)
module HasRelations
module ClassMethods
def has_relations
include InstanceMethods
has_many :relations, :as => :from
end
end
module InstanceMethods
def related(relation_type = nil)
module RelationExtensions
extend ActiveSupport::Concern
included do
# -- Constants ------------------------------------------------------------
# -- Attributes -----------------------------------------------------------
attr_accessor :relation_identifier, :relation_position
# -- AR Extensions --------------------------------------------------------
// String literal, string primitive
// This is not an object
// This doesn't have any of its own functions
var schoolName = "General Assembly"
// When I call this, it temporarily makes a String Object around it.
// Slower. I'll talk about why in a second
var upperCaseSchoolName = schoolName.toUpperCase
/*