Need to use self on methods not used on a specific instance in model.
This commit is contained in:
parent
5d0ac45115
commit
43c8e70a14
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue