= 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>