🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.ruby
Article #707

[ror] activerecords i warunkowo modyfikowalny atrybut

#707
From: Daniel Podlejski
Date: Mon, 12 Nov 2007 13:57
13 lines
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
Technical Details
Message-ID: <slrnfjgmu0.pau.underley@rincewind.underley.eu.org>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!newsfeed.tpinternet.pl!news.underley.eu.org!home.underley.eu.org!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!newsfeed.tpinternet.pl!news.underley.eu.org!home.underley.eu.org!not-for-mail
From: Daniel Podlejski <underley@underley.eu.org>
Newsgroups: pl.comp.lang.ruby
Subject: [ror] activerecords i warunkowo modyfikowalny atrybut
Date: Mon, 12 Nov 2007 13:57:20 +0000 (UTC)
Organization: Lakshmi & Underley Home
Lines: 13
Message-ID: <slrnfjgmu0.pau.underley@rincewind.underley.eu.org>
NNTP-Posting-Host: rincewind.lan
Mime-Version: 1.0
X-Trace: rincewind.underley.eu.org 1194875840 25951 192.168.66.1 (12 Nov 2007 13:57:20 GMT)
X-Complaints-To: usenet@rincewind.underley.eu.org
NNTP-Posting-Date: Mon, 12 Nov 2007 13:57:20 +0000 (UTC)
User-Agent: slrn/0.9.8.1pl2 (Debian)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit