From 3d11d0a3a047a12bfd40b61252e269cabac76225 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 15 Feb 2013 14:49:16 +0100 Subject: Basic structure for sim_cards and sim_card_providers. --- app/models/sim_card_provider.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/models/sim_card_provider.rb (limited to 'app/models/sim_card_provider.rb') diff --git a/app/models/sim_card_provider.rb b/app/models/sim_card_provider.rb new file mode 100644 index 0000000..854c61a --- /dev/null +++ b/app/models/sim_card_provider.rb @@ -0,0 +1,28 @@ +class SimCardProvider < ActiveRecord::Base + attr_accessible :name, :homepage_url, :docu_url, :api_server_url, :api_username, :api_password, :ref, :sip_server, :include_order_card_function + + # Validations + # + validates :name, + :presence => true, + :uniqueness => true + + validates :api_username, + :presence => true + + validates :api_password, + :presence => true + + validates :api_server_url, + :presence => true + + validates :sip_server, + :presence => true + + has_many :sim_cards, :dependent => :destroy + + def to_s + name.to_s + end + +end -- cgit v1.2.3