<commit_before>= Addressbook
== Instructions:

<b>To test it, in root folder run:</b>
<tt>
  rake db:create
  rake db:migrate
  rake db:seed (seeds Users to dummy app)
  cd spec/dummy/
  rails s
</tt>

<b>Root address:</<b>>
  http://localhost:3000/addressbook

<b>In non-test app we should run</b>

 <tt>rake addressbook:install:migrations</tt>

<b>mount routes</b>
<tt>
  Rails.application.routes.draw do
    mount Addressbook::Engine => "/addressbook"
  end
</tt>

<b>create User\Account\Whatever, who will have contacts</b>
<tt>
  class User < ActiveRecord::Base
    attr_accessible :email, :first_name, :last_name
    #Contacts
    has_many :account_contacts, :class_name => 'Addressbook::AccountContact', as: :owner
    #Contacts
    has_many :account_contact_groups, :class_name => 'Addressbook::AccountContactGroup', as: :owner
  end
</tt>

<b>and configure engine by making initialization file in app's config</b>

  <tt>
  #config/initializers/addressbook.rb
  
  require 'carrierwave'
  CarrierWave.configure do |config|
    config.root = ::Rails.root.to_s+"/public/"
  end

  Addressbook.configure do
    
    def current_account
      User.first if ActiveRecord::Base.connection.table_exists? 'users'
    end

    @current_account = current_account

    def image_storing_path
      return "uploads"
    end

  end
  </tt>


<i>This project rocks and uses MIT-LICENSE. Lol, it should really rock! :D</i><commit_msg>Documentation #3 :D<commit_after>= Addressbook
== Instructions:

<b>To test it, in root folder run:</b>

  rake db:create
  rake db:migrate
  rake db:seed (seeds Users to dummy app)
  cd spec/dummy/
  rails s


<b>Root address:</<b>>
  http://localhost:3000/addressbook

<b>In non-test app we should run</b>

 rake addressbook:install:migrations

<b>mount routes</b>

  Rails.application.routes.draw do
    mount Addressbook::Engine => "/addressbook"
  end


<b>create User\Account\Whatever, who will have contacts</b>

  class User < ActiveRecord::Base
    attr_accessible :email, :first_name, :last_name
    #Contacts
    has_many :account_contacts, :class_name => 'Addressbook::AccountContact', as: :owner
    #Contacts
    has_many :account_contact_groups, :class_name => 'Addressbook::AccountContactGroup', as: :owner
  end


<b>and configure engine by making initialization file in app's config</b>

  
  #config/initializers/addressbook.rb
  
  require 'carrierwave'
  CarrierWave.configure do |config|
    config.root = ::Rails.root.to_s+"/public/"
  end

  Addressbook.configure do
    
    def current_account
      User.first if ActiveRecord::Base.connection.table_exists? 'users'
    end

    @current_account = current_account

    def image_storing_path
      return "uploads"
    end

  end
  


<i>This project rocks and uses MIT-LICENSE. Lol, it should really rock! :D</i>
{'fraction_non_alphanumeric': 0.11466098686545971, 'fraction_numerical': 0.003194888178913738, 'mean_word_length': 3.8419243986254297, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 49, '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': '165935', 'n_tokens_mistral': 962, 'n_tokens_neox': 923, 'n_words': 249}