Last active
July 17, 2018 15:01
-
-
Save somethvictory/83583af7ff718716db9989b35e51cf3b to your computer and use it in GitHub Desktop.
Revisions
-
somethvictory revised this gist
Jul 17, 2018 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,4 @@ class Robot < ApplicationRecord validates :name, presence: true validates :color, presence: true -
somethvictory revised this gist
Jul 17, 2018 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,6 @@ class Robot < ApplicationRecord has_and_belongs_to_many :statuses def should_be_recycled? rusty? || loose_screews? end -
somethvictory created this gist
Jul 17, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ class Robot < ApplicationRecord validates :name, presence: true validates :color, presence: true belongs_to :color belongs_to :shipment, optional: true has_and_belongs_to_many :statuses def should_be_recycled? rusty? || loose_screews? end def rusty? statuses.rusty.present? end def loose_screws? statuses.loose_screws.present? end end