Sha256: c820e08cf8820de90ff2cd64bad97827ad1a634e4b1f7ec312a266f5d1e7e143
Contents?: true
Size: 854 Bytes
Versions: 11
Compression:
Stored size: 854 Bytes
Contents
FactoryGirl.define do factory :g5_updatable_client, class: "G5Updatable::Client" do sequence(:urn) { |n| "client_urn_#{n}" } uid { "http://client.com/#{urn}" } end factory :g5_updatable_location, class: "G5Updatable::Location" do association :client, factory: :g5_updatable_client sequence(:urn) { |n| "location_urn_#{n}" } sequence(:phone_number) {|n| "123-321-#{n}" } uid { "#{client.urn}/locations/#{urn}" } initialize_with do attrs = {} attributes.each do |key, value| if G5Updatable::Location.instance_methods.include?(key) || G5Updatable::Location.column_names.include?(key.to_s) attrs[key] = value else attrs[:properties] ||= {} attrs[:properties][key] = value end end G5Updatable::Location.new(attrs) end end end
Version data entries
11 entries across 11 versions & 1 rubygems