[OSM-dev] Mass imports (TIGER and AND)
Steve Coast
steve at asklater.com
Wed Aug 29 09:04:18 BST 2007
On 29 Aug 2007, at 00:15, Tom Hughes wrote:
> In message <41B65A2A-ADFA-4044-88A4-9816D20F1D13 at asklater.com> you
> wrote:
>
>> Not in context with this thread much but can't you do
>>
>>
>> begin
>> Node.transaction do
>> all_those_nodes do |node|
>> # create nodes
>> end
>> end
>> rescue Error => ex
>> #something fucked up, rails should abort the transaction
>> render :text => 'argggggggghhhhhh'
>> return :status => 500
>> end
>>
>> render :text => 'everything woz fine'
>
> Well the transaction's a bit pointless, but that's the sort of
> thing - you need to make sure you call the right validation between
> creating the node and saving it as we don't currently have everything
> in the right place - too much is done manually by the controller
> rather
> than being built into the model.
Why is the transaction pointless? Isn't it _good_ that the entire
call would succeed or fail?
have fun,
SteveC | steve at asklater.com | http://www.asklater.com/steve/
More information about the dev
mailing list