Skip to content

Instantly share code, notes, and snippets.

@davidpp
Created October 22, 2008 17:35
Show Gist options
  • Select an option

  • Save davidpp/18707 to your computer and use it in GitHub Desktop.

Select an option

Save davidpp/18707 to your computer and use it in GitHub Desktop.
class Question < ActiveRecord::Base
belongs_to :category
belongs_to :pack
# TODO Doit etre possible de le limiter
# a une categorie passe en parametre et au question appartenant a un set
# en particulier
named_scope :random, :limit => 1,:order => 'RAND()'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment