class Gallery

Constants

ACTIONS
PER_PAGE
RENDER_THUMBS
RENDER_TITLES

Public Class Methods

actions() click to toggle source

@deprecated, use Gallery::ACTIONS

# File lib/gallery.rb, line 106
def self.actions
  [ 'show_mini', 'show_long', 'show' ]
end
find_by_slug(slug) click to toggle source
# File lib/gallery.rb, line 43
def self.find_by_slug slug
  ::Gallery.where( galleryname: slug ).first
end
list(conditions = { :is_trash => false }) click to toggle source
# File lib/gallery.rb, line 25
def self.list conditions = { :is_trash => false }
  out = self.unscoped.where( conditions ).order_by( :created_at => :desc )
  [['', nil]] + out.map { |item| [ "#{item.created_at.strftime('%Y%m%d')} #{item.name}", item.id ] }
end

Public Instance Methods

is_premium() click to toggle source
# File lib/gallery.rb, line 14
def is_premium
  premium_tier > 0
end
premium?() click to toggle source
# File lib/gallery.rb, line 17
def premium?; is_premium; end