lowercase sql
This commit is contained in:
parent
27dcb29ba3
commit
bfcf12e5fa
|
@ -13,7 +13,7 @@ class Album < ActiveRecord::Base
|
||||||
attr_accessor :tags
|
attr_accessor :tags
|
||||||
attr_protected :path
|
attr_protected :path
|
||||||
|
|
||||||
named_scope :untouched, :conditions => "Albums.Id IN ( SELECT DISTINCT Photos.Album_Id FROM Photos WHERE Photos.description IS NULL AND Photos.Id NOT IN ( SELECT Photo_ID FROM Photo_Tags) )"
|
named_scope :untouched, :conditions => "albums.Id IN ( SELECT DISTINCT photos.album_id FROM photos WHERE photos.description IS NULL AND photos.id NOT IN ( SELECT photo_id FROM photo_tags) )"
|
||||||
|
|
||||||
def to_param
|
def to_param
|
||||||
"#{id}-#{title.parameterize}"
|
"#{id}-#{title.parameterize}"
|
||||||
|
|
|
@ -19,9 +19,9 @@ class Photo < ActiveRecord::Base
|
||||||
attr_accessor :tag_list
|
attr_accessor :tag_list
|
||||||
#attr_protected :path
|
#attr_protected :path
|
||||||
|
|
||||||
named_scope :untouched, :conditions => "Photos.description IS NULL AND Photos.Id NOT IN ( SELECT Photo_ID FROM Photo_Tags)", :include => :album
|
named_scope :untouched, :conditions => "photos.description IS NULL AND photos.id NOT IN ( SELECT photo_id FROM photo_tags)", :include => :album
|
||||||
named_scope :previous, lambda { |p,a| { :conditions => ["id < :id AND Album_Id = :album ", { :id => p, :album => a } ], :limit => 1, :order => "Id DESC"} }
|
named_scope :previous, lambda { |p,a| { :conditions => ["id < :id AND album_Id = :album ", { :id => p, :album => a } ], :limit => 1, :order => "id DESC"} }
|
||||||
named_scope :next, lambda { |p,a| { :conditions => ["id > :id AND Album_Id = :album ", { :id => p, :album => a } ], :limit => 1, :order => "Id ASC"} }
|
named_scope :next, lambda { |p,a| { :conditions => ["id > :id AND album_Id = :album ", { :id => p, :album => a } ], :limit => 1, :order => "id ASC"} }
|
||||||
|
|
||||||
def self.search(q)
|
def self.search(q)
|
||||||
if q
|
if q
|
||||||
|
|
Loading…
Reference in a new issue