Last active
August 29, 2018 08:27
-
-
Save k-rudy/161f378c2f2d43e72bee59910e7003ff to your computer and use it in GitHub Desktop.
attributes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Attributes::Extract.(params, schema: schema) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
attributes: { | |
first_name: 'Kon', | |
last_name: 'Rudy' | |
}, | |
custom_fields: [ | |
{ | |
name: 'skills' | |
values: ['Ruby on Rails', 'Ruby'] | |
} | |
], | |
positions: [ | |
{ | |
attributes: { | |
start_date: '1985-01-02', | |
current: true, | |
}, | |
custom_fields: [ | |
{ | |
name: 'company' | |
values: ['ProFinda'] | |
} | |
] | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
first_name: 'Kon', | |
last_name: 'Rudy', | |
skills: ['Ruby on Rails', 'Ruby'], | |
positions: [ | |
{ | |
start_date: '1985-01-02', | |
current: true, | |
company: 'ProFinda' | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
first_name: 'Kon', | |
last_name: 'Rudy', | |
skills: [ | |
{ | |
value: 'Ruby on Rails', | |
global_id: 'ecco_123' | |
}, | |
{ | |
value: 'Ruby', | |
weight: 3.0 | |
} | |
], | |
location: { | |
value: 'London, England, United Kingdom', | |
extra: { | |
state: 'England', | |
name: 'London', | |
country: 'United Kingdom', | |
lat: 30.02, | |
lon: 123.23 | |
} | |
}, | |
main_position: { | |
company: 'ProFinda', | |
start_date: '2001-01-01', | |
title: 'CEO' | |
}, | |
positions: [ | |
{ | |
start_date: '1985-01-02', | |
current: true, | |
company: 'ProFinda', | |
title: 'CTO' | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Profile::Update < Trailblazer::Operation | |
step :validate_schema | |
step :extract_attributes | |
step :update_profile | |
# it will go once CustomFields are migrated to Profile | |
step :assign_custom_fields | |
step :update_positions | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment