Timeline for Reduce the calls to database for validations in rails
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 7, 2015 at 13:48 | comment | added | m_x | also, in ruby there is no notion of "properties" that differ from instance methods, as in Java or Javascript for instance. The set/get convention is a workaround to avoid confusing properties with methods in the first place ("do I have to use braces after this.title ? Is it a method or a property ?"). Ruby ditched this notion of property in favor of instance variables that can only be accessed through instance methods, following the principle of least surprise and smalltalk's "message passing" paradigm. | |
Jun 13, 2015 at 6:50 | vote | accept | Chris Yeung | ||
Jun 12, 2015 at 15:26 | comment | added | 200_success |
A better explanation for the convention of not including get_… in method names is that a setter, if it existed, would be def referred_by_id= .
|
|
Jun 12, 2015 at 15:23 | comment | added | caspg | @Lyle'sMug I've edited my answer | |
Jun 12, 2015 at 15:21 | history | edited | caspg | CC BY-SA 3.0 |
added 233 characters in body
|
Jun 12, 2015 at 15:16 | history | edited | caspg | CC BY-SA 3.0 |
added 233 characters in body
|
Jun 12, 2015 at 15:01 | comment | added | Malachi |
would you please explain why you shouldn't prefix (edit it in your answer please)? and also what benefits come from Memorizing the result using ||= ?
|
|
Jun 12, 2015 at 14:43 | review | First posts | |||
Jun 12, 2015 at 15:01 | |||||
Jun 12, 2015 at 14:39 | history | answered | caspg | CC BY-SA 3.0 |