<commit_before>= Verifiable

* http://github.com/kuinak/verifiable

== Description

Creates verified associations. Verified associations are similar to regular
associations, except that a step has been taken to verify the integrity of the
association.

== Usage

Add verifiable to your Gemfile (or whatever if you're not using bundler):

  gem "verifiable"

Run the generator to create the necessary database migration and run it:

  script/generate verifiable_migration
  rake db:migrate

Include Verifiable::Associations in your classes and specify the correct type
of association:

  class User < ActiveRecord::Base

    include Verifiable::Associations
    has_many_verifiable :phone_numbers

  end

  class PhoneNumber < ActiveRecord::Base

    include Verifiable::Associations
    verifiable_for :users

  end

Create some associations that need verification:

  user = User.create
  phone_number = user.phone_numbers.create

Associated objects don't show up until they're verified:

  user.phone_numbers == [] # true

Get unverified objects like this:

  user.unverified_phone_numbers == [phone_number] # true

Get the verification code for an association:

  code = user.verification_code_for(phone_number)

Verify the association

  user.verify!(phone_number, code)

Once verified, the associated objects show up:

  user.phone_numbers == [phone_number] # true<commit_msg>updated docs<commit_after>= Verifiable

* http://github.com/kuinak/verifiable

== Description

Creates verified associations. Verified associations are similar to regular
associations, except that a step has been taken to verify the integrity of the
association.

== Usage

Add verifiable to your Gemfile (or whatever if you're not using bundler):

  gem "verifiable"

Run the generator to create the necessary database migration and run it:

  script/generate verifiable_migration
  rake db:migrate

Include Verifiable::Associations in your classes and specify the correct type
of association:

  class User < ActiveRecord::Base

    include Verifiable::Associations
    has_many_verifiable :phone_numbers

  end

  class PhoneNumber < ActiveRecord::Base

    include Verifiable::Associations
    verifiable_for :users

  end

Create some associations that need verification:

  user = User.create
  phone_number = user.phone_numbers.create

Associated objects don't show up until they're verified:

  >> user.phone_numbers == []
  => true

Get unverified objects like this:

  >> user.unverified_phone_numbers == [phone_number]
  => true

Get the verification code for an association:

  code = user.verification_code_for(phone_number)

Verify the association

  user.verify!(phone_number, code)

Once verified, the associated objects show up:

  >> user.phone_numbers == [phone_number]
  => true
{'fraction_non_alphanumeric': 0.062252608852105075, 'fraction_numerical': 0.0, 'mean_word_length': 4.661914460285132, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3540781', 'n_tokens_mistral': 782, 'n_tokens_neox': 736, 'n_words': 278}