0.0
No commit activity in last 3 years
No release in over 3 years
Allows a Rails model to behave like an ally, maybe.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.6
>= 0
 Project Readme

acts_as_ally

Allows a Rails model to behave like an ally, maybe.

Installation

Add this line to your application's Gemfile:

gem 'acts_as_ally'

And then execute:

$ bundle

Or install it yourself as:

$ gem install acts_as_ally

A Note on Testing

This gem has no tests, because setting expectations for allies is disrespectful and counterproductive.

Usage

In your model:

class Man < ActiveRecord::Base
  include ActsAsAlly
end

In console:

2.1.1 :001 > Man.count
   (0.2ms)  SELECT COUNT(*) FROM "men"
 => 10

2.1.1 :002 >  Man.not_all
    (0.1ms)  SELECT COUNT(*) FROM "men"
    Man Load (0.1ms)  SELECT "men".* FROM "men" LIMIT 1
 => [#<Man id: 1, created_at: "2014-04-28 23:22:02", updated_at: "2014-04-28 23:22:02">]

2.1.1 :003 > Man.not_all.first.cookies
    Man Load (0.2ms)  SELECT "men".* FROM "men"
    (0.1ms)  SELECT COUNT(*) FROM "men"
 => []

You Might Also Like

If you find this gem useful, check out WellActually

Contributing

  1. Fork it ( https://github.com/[my-github-username]/acts_as_ally/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request