Sha256: f3b5fecdcfb301f025bd92d68481ad07accffbb061dea1667bded614e6c11e92

Contents?: true

Size: 571 Bytes

Versions: 1

Compression:

Stored size: 571 Bytes

Contents

class G5Updatable::LocationsUpdater
  def initialize(g5_locations)
    @g5_locations = g5_locations
  end

  def update
    @g5_locations.each do |g5_location|
      attributes = g5_location.location_hash.dup
      G5Updatable::Location.
          find_or_initialize_by(uid: attributes[:uid]).
          update_attributes!(
              urn:        attributes[:urn],
              name:       attributes[:name],
              client_uid: attributes[:client_uid],
              properties: attributes,
              updated_at: DateTime.now
          )
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
g5_updatable-0.5.1 lib/g5_updatable/locations_updater.rb