2012-01-30 20:39:34 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2012-01-27 15:35:18 +00:00
|
|
|
class ProjectImport < ActiveRecord::Base
|
|
|
|
belongs_to :project
|
|
|
|
|
2012-01-28 02:05:31 +00:00
|
|
|
validates :name, :uniqueness => {:case_sensitive => false}, :presence => true
|
|
|
|
|
2012-01-28 01:04:11 +00:00
|
|
|
scope :by_name, lambda {|name| where('project_imports.name ILIKE ?', name)}
|
|
|
|
|
2012-01-27 15:35:18 +00:00
|
|
|
after_initialize lambda {|r| r.file_mtime ||= Time.current - 10.years } # default
|
|
|
|
end
|