summaryrefslogtreecommitdiff
path: root/app/models/sim_card.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-15 15:04:07 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-15 15:04:07 +0100
commit714fd5feb8551159bcdb982e42ff4585635db209 (patch)
tree9442c98cd9e7bf95f48e36b7d3220be6f4cb0e7c /app/models/sim_card.rb
parent72a56d20496e58a1d1debc3a859d40aa73e246b5 (diff)
parent14e8e9923666991703f747a4abfd6fbfb96d2dc1 (diff)
Merge branch 'sim_card' into develop
Diffstat (limited to 'app/models/sim_card.rb')
-rw-r--r--app/models/sim_card.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/sim_card.rb b/app/models/sim_card.rb
index 2cbf76b..806beab 100644
--- a/app/models/sim_card.rb
+++ b/app/models/sim_card.rb
@@ -22,4 +22,15 @@ class SimCard < ActiveRecord::Base
validates :sim_number,
:presence => true
+ after_initialize :set_defaults
+
+ def to_s
+ self.sim_number.to_s
+ end
+
+ private
+ def set_defaults
+ self.state ||= 'not activated'
+ end
+
end