Sha256: 69f34519865622cf5f4c6ef343d070025ded306366730c7230e587ec2d42df90

Contents?: true

Size: 945 Bytes

Versions: 13

Compression:

Stored size: 945 Bytes

Contents

class Whizbang < ActiveForce::SObject

  field :id,                   from: 'Id'
  field :checkbox,             from: 'Checkbox_Label', as: :boolean
  field :text,                 from: 'Text_Label'
  field :date,                 from: 'Date_Label', as: :date
  field :datetime,             from: 'DateTime_Label', as: :datetime
  field :picklist_multiselect, from: 'Picklist_Multiselect_Label', as: :multipicklist
  field :boolean,              from: 'Boolean_Label',  as: :boolean
  field :percent,              from: 'Percent_Label',  as: :percent
  field :estimated_close_date, as: :datetime
  field :updated_from,         as: :string
  field :dirty_attribute,      as: :boolean

  before_save :set_as_updated_from_rails
  after_save :mark_dirty

  validates :percent, presence: true, if: :boolean

  private

  def set_as_updated_from_rails
    self.updated_from = 'Rails'
  end

  def mark_dirty
    self.dirty_attribute = true
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
active_force-0.24.0 spec/support/whizbang.rb
active_force-0.23.0 spec/support/whizbang.rb
active_force-0.22.1 spec/support/whizbang.rb
active_force-0.22.0 spec/support/whizbang.rb
active_force-0.21.0 spec/support/whizbang.rb
active_force-0.20.1 spec/support/whizbang.rb
active_force-0.20.0 spec/support/whizbang.rb
active_force-0.19.0 spec/support/whizbang.rb
active_force-0.18.0 spec/support/whizbang.rb
active_force-0.17.0 spec/support/whizbang.rb
active_force-0.16.0 spec/support/whizbang.rb
active_force-0.15.1 spec/support/whizbang.rb
active_force-0.15.0 spec/support/whizbang.rb