Module: ActiveRecord::RulesIOExtension

Defined in:
lib/rulesio/active_record_extension.rb

Instance Method Summary collapse

Instance Method Details

#saveObject



3
4
5
6
7
# File 'lib/rulesio/active_record_extension.rb', line 3

def save(*)
  result = super
  send_invalid_model_event if result == false
  result
end

#save!Object



9
10
11
12
13
14
15
16
# File 'lib/rulesio/active_record_extension.rb', line 9

def save!(*)
  begin
    super
  rescue ::ActiveRecord::RecordNotSaved
    send_invalid_model_event
    raise ::ActiveRecord::RecordNotSaved
  end
end