Sha256: 789a4e2dcbb9dc08727e28c0280721f897530409d80cd4e1dc27dfd0d4fbba41

Contents?: true

Size: 1.1 KB

Versions: 25

Compression:

Stored size: 1.1 KB

Contents

# == Schema Information
#
# Table name: oai_endpoints
#
#  id              :integer(4)      not null, primary key
#  uri             :string(2083)
#  display_uri     :string(2083)
#  metadata_prefix :string(255)
#  title           :string(1000)
#  short_title     :string(100)
#
class OaiEndpoint < ActiveRecord::Base
  
  belongs_to :contributor, :class_name => 'User', :foreign_key => 'contributor_id'
  belongs_to :default_language, :class_name => 'Language', :foreign_key => 'default_language_id'
  
  validates_presence_of :uri
  
  named_scope :banned, :conditions => "status < 0"
  named_scope :valid, :conditions => "status >= 0"
  named_scope :by_title, :order => "title ASC"
  named_scope :recent, lambda { { :conditions => ['created_at > ?', 1.week.ago] } }
  named_scope :by_newest, :order => "created_at DESC", :include => [:default_language]
  
  attr_protected :status, :contributor_id
  
  def banned?
    self.status == MuckRaker::Status::BANNED
  end

  def pending?
    self.status == MuckRaker::Status::PENDING
  end

  def inform_admin
    RakerMailer.deliver_notification_feed_added(self)
  end
  
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
muck-raker-0.2.11 app/models/oai_endpoint.rb
muck-raker-0.2.10 app/models/oai_endpoint.rb
muck-raker-0.2.9 app/models/oai_endpoint.rb
muck-raker-0.2.8 app/models/oai_endpoint.rb
muck-raker-0.2.7 app/models/oai_endpoint.rb
muck-raker-0.2.6 app/models/oai_endpoint.rb
muck-raker-0.2.5 app/models/oai_endpoint.rb
muck-raker-0.2.4 app/models/oai_endpoint.rb
muck-raker-0.2.3 app/models/oai_endpoint.rb
muck-raker-0.2.2 app/models/oai_endpoint.rb
muck-raker-0.2.0 app/models/oai_endpoint.rb
muck-raker-0.1.49 app/models/oai_endpoint.rb
muck-raker-0.1.48 app/models/oai_endpoint.rb
muck-raker-0.1.47 app/models/oai_endpoint.rb
muck-raker-0.1.46 app/models/oai_endpoint.rb
muck-raker-0.1.45 app/models/oai_endpoint.rb
muck-raker-0.1.43 app/models/oai_endpoint.rb
muck-raker-0.1.42 app/models/oai_endpoint.rb
muck-raker-0.1.41 app/models/oai_endpoint.rb
muck-raker-0.1.40 app/models/oai_endpoint.rb