For those interested, this is being discussed here:
http://wm.lighthouseapp.com/projects/4819/tickets/664-no-record-update-after-upgrade-to-097#ticket-664-5
A temporary work-around suggested by sickill on #merb was to add the
:lazy => false option to a Text property in my model.
Supposedly this "only" affects models with Text properties and/or
associations. Ouch ...
Cheers,
T
Thomas Lee wrote:
> Oh and I should probably mention that logging the SQL indicates that no
> attempts are made by DM to actually update any records.
>
> Cheers,
> T
>
> Thomas Lee wrote:
>
>> Here's a bit more background information:
>>
>> I'm personally using DataMapper. My action code looks like this:
>>
>> @foo = Foo.get(params[:id])
>> target = :failure
>> if @foo.verification_code == params[:code]
>> if @foo.update_attributes(:status => Foo::ACTIVE)
>> target = :success
>> end
>> end
>> render target
>>
>> This renders the "success" view. In the model:
>>
>> property :status, String, :nullable => false
>>
>> validates_format :status, :with => Proc.new { |value|
>> [INACTIVE, PENDING, ACTIVE].include?(value)
>> }
>>
>> Nothing else implies the inclusion or exclusion of the status property
>> wrt updates.
>>
>> Any ideas?
>>
>> Cheers,
>> T
>>
>> Thomas Lee wrote:
>>
>>
>>> I'm experiencing something very similar to what's been described in this
>>> issue and I'm definitely not using attr_accessible.
>>>
>>> Or are you saying that attr_accessible is *required*?
>>>
>>> Cheers,
>>> T
>>>
>>> Ryan Bigg wrote:
>>>
>>>
>>>
>>>> sounds like attr_accessible
>>>> -----
>>>> Ryan Bigg
>>>> Freelancer
>>>> http://frozenplague.net
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On 24/11/2008, at 10:24 AM, Andre wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> I'm further investigating the problem. I've tried to update the title
>>>>> field, no success. I've created another string field called
>>>>> "headline", and I've tried to update it (always with the
>>>>> update_attributes function). Again, no success. The only way for me to
>>>>> update the title field or the headline field is:
>>>>>
>>>>> @article.title = article['title']
>>>>> @article.save
>>>>>
>>>>> But then I've created another field, called "articletitle", and, with
>>>>> great surprise from me, this worked fine.
>>>>>
>>>>> If I check the logs, with 'title' and 'headline' the update sql
>>>>> function is performed only on my other fields (namely 'body' and
>>>>> 'excerpt'), while for 'articletitle', all the fields are correctly
>>>>> updated.
>>>>>
>>>>> So, could it be a naming problem? Like some keywords are reserved, and
>>>>> some others aren't? Other than that I really can't explain this weird
>>>>> behaviour.
>>>>>
>>>>>
>>>>> Are there any merb devs that can make it clear about my problem?
>>>>>
>>>>> Thanks!
>>>>>
>>>>>
>>>>> On 24 Nov, 00:26, Andre <[EMAIL PROTECTED]> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Yeah, I've had included that dependency in my dependencies.rb file...
>>>>>>
>>>>>> Still, I get this strange behaviour again, but only for the title
>>>>>> field of my resource... Like, everything is saved but the title. It's
>>>>>> just weird, everything else is working fine...
>>>>>>
>>>>>> On 23 Nov, 06:25, "Peter Dirickson" <[EMAIL PROTECTED]> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Andre,
>>>>>>>
>>>>>>> Did you had dependency "merb-action-args" setup up?
>>>>>>>
>>>>>>> That's what using when you do:
>>>>>>>
>>>>>>> def update(id, article)
>>>>>>>
>>>>>>> instead of
>>>>>>>
>>>>>>> def update(params[:id], params[:article])
>>>>>>>
>>>>>>> Peter.
>>>>>>>
>>>>>>> On Sat, Nov 22, 2008 at 11:54 AM, Andre <[EMAIL PROTECTED]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> nevermind... I really don't know what I've done, but for some
>>>>>>>> reason
>>>>>>>> it works now :/ I haven't changed a single line of code... I've
>>>>>>>> just
>>>>>>>> set up my application again from ground up...
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---