Acts As Phoneable plugin

Plugin details

Allows for phone numbers to be added to multiple and different models.

Repositoryhttps://svn.nbarthelemy.com/plugins/acts_as_phoneable/ Tags phone LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install https://svn.nbarthelemy.com/plugins/acts_as_phoneable/

* Make you ActiveRecord model act as phone_numberable.

 class Model < ActiveRecord::Base
   acts_as_phoneable
 end
 


* Add a phone number to a model instance

 model = Model.new
 phone_number = Comment.new
 phone_number.number_type = 'HOME' 
 phone_number.number = '5555555555'
 phone_number.ext = '1234' 
 model.phone_numbers << phone_number
 


* Each phone_number reference phone_numberable object

 model = Model.find(1)
 model.phone_numbers.get(0).phoneable == model
 

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (1 older version) | Last edited by: scott, 4 months ago