Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
ActiveRecord::Base can has flagz
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
Gemfile
LICENSE
README.rdoc
Rakefile
can_has_flagz.gemspec

README.rdoc

can_has_flagz

Provides handy flags hash for your models

Example Usage

User Model

class User < ActiveRecord::Base
  can_has_flagz

  after_save :send_confirmation_email

protected

  def send_confirmation_email
    UserMailer.deliver_confirmation_mail(self) unless flag[:skip_confirmation_email]
  end

end

Some Controller Method

@user = User.new(params[:user])
@user.flag[:skip_confirmation_email] = true
@user.save

Copyright

Copyright © 2011 Naomi Kyoto. See LICENSE for details.

Something went wrong with that request. Please try again.