RubyGems Navigation menu

boxey 0.0.5

Boxey provides the [] element reference operator to ActiveRecord classes. # Installation Add this line to your Gemfile: `gem 'boxey'` # Configuration With the boxey gem installed, all ActiveRecord classes gain the [] method, which fetches by the class's primary_key by default. You may specify additional fields, presumably fields that validate uniqueness, by calling the boxey method. class User < ActiveRecord::Base boxey :id, :login, :email validates :login, uniqueness: true validates :email, uniqueness: true end # Use Given the configuration above: `User[1]` returns the first User with an id (or login or email) of `1`. `User['me@example.com']` returns the first User with an email (or id or login) of `'me@example.com'`. `[]` returns `nil` if no match is found.

Gemfile:
= Copiar al portapapeles ¡Copiado!

instalar:
=

Versiones:

  1. 1.0 - November 19, 2012 (3,5 KB)
  2. 0.0.5 - October 19, 2012 (3,5 KB)
  3. 0.0.3 - October 12, 2012 (3,5 KB)
  4. 0.0.2 - October 12, 2012 (3,5 KB)
  5. 0.0.1 - October 12, 2012 (3,5 KB)
Mostrar todas las versiones (6 total)

dependencias de Runtime (1):

dependencias de Development (2):

acts_as_fu >= 0
rspec >= 0

Propietarios:

Autores:

  • Rob Head, Ryan Spore

SHA 256 checksum:

4ae71b40755ea958632b206030a3f9f4b6c49aa93016cd2d465c52c6c48a634d

Total de descargas 18.824

Para esta versión 3.638

Licencias:

N/A

Versión de Ruby requerida: Ninguno

Enlace: