5 6 7 8 9 10 11
# File 'lib/either/active_model_helpers.rb', line 5 def to_either if self.errors.present? Either::Left.new(self.errors) else Either::Right.new(self) end end