Sha256: 373a960921434c81adb9be3b18f949a7d5a0500ab6efc239666a315bd35f5a76

Contents?: true

Size: 575 Bytes

Versions: 8

Compression:

Stored size: 575 Bytes

Contents

class RubySyncOperation < ActiveRecord::Base
  
  belongs_to :event,
            :class_name => "RubySyncEvent",
            :foreign_key => "ruby_sync_event_id"
            
  has_many :values,
          :class_name => "RubySyncValue",
          :foreign_key => "ruby_sync_operation_id"
          
          
  def self.create_for record, type
    record.class.content_columns.map do |column|
      values = [ RubySyncValue.new(:value=>record[column.name].to_s) ]
      RubySyncOperation.new :operation=>type, :field_name=>column.name, :values=>values
    end
  end

  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rubysync-0.0.1 examples/ar_webapp/app/models/ruby_sync_operation.rb
rubysync-0.0.3 examples/ar_webapp/app/models/ruby_sync_operation.rb
rubysync-0.0.2 examples/ar_webapp/app/models/ruby_sync_operation.rb
rubysync-0.0.5 examples/ar_webapp/app/models/ruby_sync_operation.rb
rubysync-0.1.1 examples/ar_webapp/app/models/ruby_sync_operation.rb
rubysync-0.0.4 examples/ar_webapp/app/models/ruby_sync_operation.rb
rubysync-0.1.0 examples/ar_webapp/app/models/ruby_sync_operation.rb
rubysync-0.2.1 examples/ar_webapp/app/models/ruby_sync_operation.rb