Translation migrations
This commit is contained in:
		
							parent
							
								
									f5c7cca626
								
							
						
					
					
						commit
						1aee8c09da
					
				| @ -9,11 +9,10 @@ namespace :translations do | |||||||
| 			if t['data'] | 			if t['data'] | ||||||
| 				t['data'].each { |tt| | 				t['data'].each { |tt| | ||||||
| 					hash = ActiveSupport::JSON.decode(tt) | 					hash = ActiveSupport::JSON.decode(tt) | ||||||
|  | 					begin | ||||||
| 						translation = Translation.find(hash['id']) | 						translation = Translation.find(hash['id']) | ||||||
| 					if translation |  | ||||||
| 						#t.assign_attributes(hash) |  | ||||||
| 						translation.update_attributes(hash) | 						translation.update_attributes(hash) | ||||||
| 					else | 					rescue | ||||||
| 						Translation.new(hash).save | 						Translation.new(hash).save | ||||||
| 					end | 					end | ||||||
| 				} | 				} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user