Sha256: 277d54d40e819e3d6b5e51675728e86dcb11bffa02a439ee3774d1980fe47309

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

# ConfirmedAttributes

Confirmed attributes for ActiveRecord.

Adds functionality confirmable attributes to models.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'confirmed_attributes'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install confirmed_attributes

## Usage

Add confirmable_attribute method to your model:

```ruby
class User < ActiveRecord::Base
  confirmable_attribute :email
end
```

And use it:

```ruby
@user = User.create email: "your_mail"

@user.confirmable_attributes # => [:email]
User.confirmable_attributes # => [:email]
@user.confimed_attributes # => []
@user.confirmed_attribute? :email # => false

@user.confirm :email # => true
@user.confimed_attributes # => [#<ConfirmedAttributes::Control:0x007f2eacd2f730> name: "email", value: "your_mail"...]
@user.confirmed_attribute? :email # => true

@user.unconfirm :email # => true
```

Simple, yeah?

## Contributing

1. Fork it ( https://github.com/[my-github-username]/confirmed_attributes/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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
confirmed_attributes-0.2.0 README.md