Thread View: pl.comp.lang.ruby
2 messages
2 total messages
Started by Daniel Podlejski
Mon, 12 Nov 2007 13:57
[ror] activerecords i warunkowo modyfikowalny atrybut
Author: Daniel Podlejski
Date: Mon, 12 Nov 2007 13:57
Date: Mon, 12 Nov 2007 13:57
13 lines
1142 bytes
1142 bytes
Pytanie początkującego, być może banalne - jak spowodować, żeby
możliwość ustawiania jednego atrybutu była zależna od wartości innego?
def costam=(value)
if status > 1
self.costam = value
end
end
oczywiście nie działa tak jakbym chciał, i wcale mnie to nie dziwi ;)
--
Daniel Podlejski
Re: [ror] activerecords i warunkowo modyfikowalny atrybut
Author: Daniel Podlejski
Date: Mon, 12 Nov 2007 14:08
Date: Mon, 12 Nov 2007 14:08
10 lines
1076 bytes
1076 bytes
No to sam sobie odpowiem - pomogło oczywiście dogłębniejsze RTFM ;)
def costam=(value)
if self.status > 1
write_attribute(:costam, value)
end
end
--
Daniel Podlejski
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads