Re: [Rails] a newbie questionadding database field to a model basing only on schema (without model regenerat

2013-08-13 Thread Colin Law
On 13 August 2013 17:46, Scott Ribe wrote: > On Aug 13, 2013, at 12:43 AM, Valentin Kotelnitski > wrote: > >> As I see now there is no way of not regenerating model. > > No, there is absolutely no need to re-generate your model. *That* is what > people are telling you. > >> Earlier I just >> ho

Re: [Rails] a newbie questionadding database field to a model basing only on schema (without model regenerat

2013-08-13 Thread Scott Ribe
On Aug 13, 2013, at 12:43 AM, Valentin Kotelnitski wrote: > As I see now there is no way of not regenerating model. No, there is absolutely no need to re-generate your model. *That* is what people are telling you. > Earlier I just > hoped it could be possible to add a piece of hand-written co

Re: [Rails] a newbie questionadding database field to a model basing only on schema (without model regenerat

2013-08-12 Thread Walter Lee Davis
Actually, this is a better write-up, forget what I suggested earlier, that's a stub to a book you'd need to buy. (And I think everyone should own it, too.) https://en.wikipedia.org/wiki/Active_record_pattern Walter On Aug 12, 2013, at 2:07 PM, Scott Ribe wrote: > On Aug 12, 2013, at 11:57 AM,

Re: [Rails] a newbie questionadding database field to a model basing only on schema (without model regenerat

2013-08-12 Thread Walter Lee Davis
If you're curious, read up on the Active Record (two words) pattern here: http://martinfowler.com/eaaCatalog/activeRecord.html Each time you get an object, that object is built up from whatever is in the database record that backs it as of that moment. You either get the default value for that

Re: [Rails] a newbie questionadding database field to a model basing only on schema (without model regenerat

2013-08-12 Thread Scott Ribe
On Aug 12, 2013, at 11:57 AM, Valentin Kotelnitski wrote: > Except that I need a property in my model of a table corresponding to a > newly migrated column. > That is the question. ? Rails models automatically derive from the current schema. If you're actually asking what I think you're asking