diff options
Diffstat (limited to 'app/models/chouette/company.rb')
| -rw-r--r-- | app/models/chouette/company.rb | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/app/models/chouette/company.rb b/app/models/chouette/company.rb new file mode 100644 index 000000000..d0375b2e6 --- /dev/null +++ b/app/models/chouette/company.rb @@ -0,0 +1,14 @@ +class Chouette::Company < Chouette::TridentActiveRecord +  has_many :lines + +  validates_format_of :registration_number, :with => %r{\A[0-9A-Za-z_-]+\Z}, :allow_nil => true, :allow_blank => true +  validates_presence_of :name +  validates_format_of :url, :with => %r{\Ahttps?:\/\/([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?\Z}, :allow_nil => true, :allow_blank => true + +  def self.nullable_attributes +    [:organizational_unit, :operating_department_name, :code, :phone, :fax, :email, :url, :time_zone] +  end + + +end + | 
