Sha256: 8476130aa3b6ebc0bfc2ee07dadfe3f38c2e6e12e96e0d9eb6201d51854ed15f
Contents?: true
Size: 749 Bytes
Versions: 40
Compression:
Stored size: 749 Bytes
Contents
module EnjuLibrary module EnjuItem extend ActiveSupport::Concern included do has_one :accept scope :accepted_between, lambda{|from, to| includes(:accept).where('items.created_at BETWEEN ? AND ?', Time.zone.parse(from).beginning_of_day, Time.zone.parse(to).end_of_day)} belongs_to :shelf, counter_cache: true, validate: true validates_associated :shelf searchable do string :library do shelf.library.name if shelf end end end def shelf_name shelf.name end def hold?(library) return true if shelf.library == library false end def library_url "#{LibraryGroup.site_config.url}libraries/#{shelf.library.name}" end end end
Version data entries
40 entries across 38 versions & 2 rubygems