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 Component < ActiveRecord::Base | |
has_many :sub_components | |
#this is the 'other side' of the has_many :components statement | |
belongs_to :component | |
has_one :component | |
end |
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 Cabinet < ActiveRecord::Base | |
has_many :components do | |
def front_facing | |
all(:conditions => {:orientation => "A"}) | |
end | |
def front_facing_grouped_by_elevation_index | |
front_facing.group_by{|component| component.elevation_index - component.component_model.height + 1} | |
end |
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 Component < ActiveRecord::Base | |
belongs_to :cabinet | |
belongs_to :component_model | |
has_many :port, :as => :device, :extend => CreatePortFromModel | |
has_many :sub_components | |
def elevation | |
orientation + elevation_index.to_s | |
end |
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 Component < ActiveRecord::Base | |
belongs_to :cabinet | |
belongs_to :component_model | |
has_many :port, :as => :device, :extend => CreatePortFromModel | |
has_many :sub_components | |
def elevation | |
orientation + elevation_index.to_s | |
end |
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 Vlan < ActiveRecord::Base | |
include VlanType | |
validates_inclusion_of :type, :in => [:public, :private, :static] | |
end |
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
module ApplicationHelper | |
def navigator(*columns, &block) | |
haml_tag :div, :id => "navigator", :class => "table" do | |
haml_tag :div, :class => "header" do | |
columns.each do |column| | |
haml_tag :div do | |
haml_concat column | |
end | |
end | |
end |
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
# See http://help.github.com/ignore-files/ for more about ignoring files. | |
# | |
# If you find yourself ignoring temporary files generated by your text editor | |
# or operating system, you probably want to add a global ignore instead: | |
# git config --global core.excludesfile ~/.gitignore_global | |
# Ignore bundler config | |
/.bundle | |
# Ignore the default SQLite database. |
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 Cable < CopyableActiveRecord | |
has_many :ports, :through => :connections | |
belongs_to :type, :class_name => 'CableType' | |
end |
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 Cable < ActiveRecord::Base | |
has_many :connections, :class_name => 'Port', :autosave => false | |
end |
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 Strands.Models.Site extends Backbone.Model | |
url: -> | |
if this.isNew() | |
'/sites.json' | |
else | |
'/sites/' + this.id + '.json' | |
link: -> '/sites/' + this.id | |
name: -> @get('name') |
OlderNewer