Rubygems | Latest Versions for boxeyhttps://rubygems.org/gems2023-09-28T03:17:38Zboxey (1.0)https://rubygems.org/gems/boxey/versions/1.02012-11-19T05:58:02ZRob Head, Ryan Spore, Sean CulverProvides the [] element reference operator to ActiveRecord classes.
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.
boxey (0.0.5)https://rubygems.org/gems/boxey/versions/0.0.52012-10-19T12:39:55ZRob Head, Ryan SporeProvides the [] element reference operator to ActiveRecord classes.
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.
boxey (0.0.4)https://rubygems.org/gems/boxey/versions/0.0.42012-10-19T12:17:14ZRob Head, Ryan SporeBoxey provides element reference (the [] operator) to ActiveRecord classes.
Boxey
=====
Boxey provides the [] operator to ActiveRecord classes.
# Documentation
Add this line to your Gemfile:
`gem "boxey", :git => "git://github.com/roguevalley/boxey.git"`
All ActiveRecord classes gain the [] method as an accessor. By default, it fetches by the class's primary_key.
# Configuration
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.
boxey (0.0.3)https://rubygems.org/gems/boxey/versions/0.0.32012-10-12T05:53:37ZRob Head, Ryan SporeBoxey provides element reference (the [] operator) to ActiveRecord classes.
Boxey provides element reference (the [] operator) to ActiveRecord classes. boxey (0.0.2)https://rubygems.org/gems/boxey/versions/0.0.22012-10-12T05:47:01ZRob Head, Ryan SporeBoxey provides element reference (the [] operator) to ActiveRecord classes.
Boxey provides element reference (the [] operator) to ActiveRecord classes. boxey (0.0.1)https://rubygems.org/gems/boxey/versions/0.0.12012-10-12T05:34:48ZRob Head, Ryan SporeElement reference operator for ActiveRecord classes.
A little gem for the sooper lazy.