Module SmsOnRails::ServiceProviders::HasASmsServiceProvider::ClassMethods
In: lib/sms_on_rails/activerecord_extensions/has_a_sms_service_provider.rb

Methods

Public Instance methods

Add an accessor to the service provider

For example, if the provider was referenced by name by calling method ‘sms_vendor‘

  has_an_sms_service_provider :method => 'sms_vendor', :type => :name, :accessor_method => 'sms_service_provider'

would define an instance method sms_service_provider and sms_service_provider_id that returns the appropriate instance and id respectively.

Likewise if :type => :id or there is a column on the :id field, sms_service_provider_id would be defined

Options

:type the key field (either :id or :name). the one that actually stores the data The provider is referenced by provider_id by default :method the name of the method that should be invoked to get the wanted id or name :accessor_name the name of the new method accessor

[Validate]