Need to use self on methods not used on a specific instance in model.

This commit is contained in:
Andrew Tomaka 2012-05-03 01:37:30 -04:00
parent 5d0ac45115
commit 43c8e70a14

View file

@ -3,11 +3,11 @@ class Link < ActiveRecord::Base
validates :url, :presence => true, :url => true validates :url, :presence => true, :url => true
validates :description, :presence => true validates :description, :presence => true
def released def self.released
Link.where("DATE(release) <= DATE(?)", Time.now).order("release DESC") Link.where("DATE(release) <= DATE(?)", Time.now).order("release DESC")
end end
def goto(id = nil) def self.goto(id = nil)
return false if nil return false if nil
Link.transaction do Link.transaction do