Module: SmsOnRails::ModelSupport::Draft

Included in:
Draft
Defined in:
lib/sms_on_rails/model_support/draft.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/sms_on_rails/model_support/draft.rb', line 5

def self.included(base)#:nodoc
  base.send :accepts_nested_attributes_for, :outbounds
  #base.acts_as_deliverable :fatal_exception => SmsOnRails::FatalSmsError

  base.validates_presence_of  :message
  base.validate :validates_message_length

  base.class_inheritable_accessor  :default_header
  base.class_inheritable_accessor  :default_footer
  base.class_inheritable_accessor  :max_message_length
  
  base.max_message_length = SmsOnRails::ServiceProviders::Base.max_characters

  base.validates_associated :outbounds

  base.send :include, InstanceMethods
  base.send :extend,  ClassMethods
end