Hi, I''m looking at the type_cast method in activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb I can see that the case statement is dependant on the variable "type" which looks like a local variable. But where is type set? Maybe this is more of a Ruby question. Thanks, Peter def type_cast(value) return nil if value.nil? case type when :string then value when :text then value when :integer then value.to_i rescue value ? 1 : 0 when :float then value.to_f # ...more... else value end end _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Nov 13, 2005, at 8:45 PM, Peter Michaux wrote:> I can see that the case statement is dependant on the variable > "type" which looks like a local variable. But where is type set? > Maybe this is more of a Ruby question.That''s a call to the type method on Column. jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (Darwin) iD8DBQFDeBnLAQHALep9HFYRAhKnAJ4zTnXd20N3t1/yoBsKsfe2OpIuQQCfVMC3 QLqrql6YNs9tnYScaViguOc=34/i -----END PGP SIGNATURE-----
Peter- type is a ruby method that returns the type or class of the object like this: a = "this is a string" a.type #=> String HTH -Ezra On Nov 13, 2005, at 8:45 PM, Peter Michaux wrote:> Hi, > > I''m looking at the type_cast method in > activerecord/lib/active_record/connection_adapters/abstract/ > schema_definitions.rb > > I can see that the case statement is dependant on the variable > "type" which looks like a local variable. But where is type set? > Maybe this is more of a Ruby question. > > Thanks, > Peter > > > def type_cast(value) > return nil if value.nil? > case type > when :string then value > when :text then value > when :integer then value.to_i rescue value ? 1 : 0 > when :float then value.to_f > # ...more... > else value > end > end > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org 509-577-7732
ROR community, I have been using Rails now for just two weeks. I am very happy with what I have found and am overly impressed with the quality and timeliness of feedback that this community provides. I wanted to take a moment to explain briefly my background and how I ended up here. Perhaps this will not be of personal interest to anyone, but it speaks volumes about Rails. I have been professionally developing applications for over 10 years, the last seven of which were done as an independent consultant. Historically, I avoided unix, linux, and anything related like the plague. Not because it was not good technology, but because I hid under the Microsoft umbrella. Now I''m involved with a startup and licensing is a major issue. It has forced me to step into this vast world of open source software and allowed me to confront one of my biggest technical fears and weaknesses the LAMP stack. Desperately needing an open source CRM solution. I first found SugarCRM, then I stumbled upon vTiger. Both had their strengths and their weaknesses. The major problem, though, was customization. I am not a PHP programmer but the language seemed simple enough. However, with both of the above packages, I found the code to be horribly difficult to follow. I found single functions containing over 800 lines of code. After a few weeks of bouncing back and forth between the two of them, I finally realized I was dealing with something I didn''t want to deal with. I quit. I began a new search. Realizing that probably nothing open source was going to be any better than what I had already found, I was willing to build something custom. I figured I would start with bare bones functionality and enhance as time permitted. I found ActiveGrid. Something that looks quite promising, but little/no community to back it. I downloaded it, played with it a bit and was pretty happy with what I saw. I ran into a problem...no one was available to answer it. No community. Just a few forums that are largely untouched on SourceForge. Maybe in a year or two it will be where it needs to be but for now it was just too risky for me to justify. Ruby on Rails kept popping up in various places forums, blogs, etc... I had never heard of Ruby or Rails (remember my background). Something caught my eye somewhere and led me down this path. The community is so strong and that is very impressive to me. I feel very ignorant to this new world it is almost like starting over from scratch. BizTalk, C#, ASP.NET, WebServices, XML, XSLT, VB, COM/DCOM, SQL, etc... - no problem. I have been very isolated to the Microsoft world. I must say that I find all the different terminology, applications, mechanisms for updates, etc... in the open source community to be very intimidating. But I LOVE Rails. In just a little over a week of playing around with it, I have made significant progress on building a custom CRM solution. To be sure, I have weeks ahead of me to get a fully functional system. But I know what I need to do is possible. The Proof of Concept is complete and it is very true that this framework allows you to accomplish more with less code. If you have seen the vTiger interface then you will know what my CRM solution will look like. I have plugged Rails into that look and feel and am making great progress each day. I hope to one day publish it as open source for others to benefit from as well. As a bonus, I have a fully functional Asterisk PBX (open source) managing the phone system. Wow...how about that? Yes, I will tie it into Ruby or borrow someone else''s code that has already done it. Thank you David for providing this framework. Thank you ROR community for providing the kind of support that you provide to make people like me willing to take a risk on something that isn''t even at Release 1.0 yet! Respectfully, Michael --------------------------------- Yahoo! FareChase - Search multiple travel sites in one click. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
CSN wrote:> So you come from .Net/C#? How does Rails/Ruby compare? >I just about started to write an opinion, when I looked at who is asking. cool_screen_name9001-/E1597aS9LQAvxtiuMwx3w@public.gmane.org Hmm... Good old Ruby vs. Python flame war, anyone? .NET is GREAT for anyone who likes drawing web forms in a visual designer and creating code with GUI wizards. I doubt you will find adepts of this method on the Rails list. However, there are quite a few in real life, so it certainly has its target audience. Let''s leave it at that. Alex
So you come from .Net/C#? How does Rails/Ruby compare? csn --- Michael <codeslush-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> ROR community, > > > I have been using Rails now for just two weeks. I > am very happy with what I have found and am overly > impressed with the quality and timeliness of > feedback that this community provides. I wanted to > take a moment to explain briefly my background and > how I ended up here. Perhaps this will not be of > personal interest to anyone, but it speaks volumes > about Rails. > > > I have been professionally developing applications > for over 10 years, the last seven of which were done > as an independent consultant. Historically, I > avoided unix, linux, and anything related like the > plague. Not because it was not good technology, but > because I hid under the Microsoft umbrella. Now I''m > involved with a startup and licensing is a major > issue. It has forced me to step into this vast world > of open source software and allowed me to confront > one of my biggest technical fears and weaknesses > the LAMP stack. > > > Desperately needing an open source CRM solution. > I first found SugarCRM, then I stumbled upon vTiger. > Both had their strengths and their weaknesses. The > major problem, though, was customization. I am not a > PHP programmer but the language seemed simple > enough. However, with both of the above packages, I > found the code to be horribly difficult to follow. I > found single functions containing over 800 lines of > code. After a few weeks of bouncing back and forth > between the two of them, I finally realized I was > dealing with something I didn''t want to deal with. I > quit. > > > I began a new search. Realizing that probably > nothing open source was going to be any better than > what I had already found, I was willing to build > something custom. I figured I would start with bare > bones functionality and enhance as time permitted. I > found ActiveGrid. Something that looks quite > promising, but little/no community to back it. I > downloaded it, played with it a bit and was pretty > happy with what I saw. I ran into a problem...no one > was available to answer it. No community. Just a few > forums that are largely untouched on SourceForge. > Maybe in a year or two it will be where it needs to > be but for now it was just too risky for me to > justify. > > > Ruby on Rails kept popping up in various places > forums, blogs, etc... I had never heard of Ruby or > Rails (remember my background). Something caught my > eye somewhere and led me down this path. The > community is so strong and that is very impressive > to me. I feel very ignorant to this new world it > is almost like starting over from scratch. BizTalk, > C#, ASP.NET, WebServices, XML, XSLT, VB, COM/DCOM, > SQL, etc... - no problem. I have been very isolated > to the Microsoft world. I must say that I find all > the different terminology, applications, mechanisms > for updates, etc... in the open source community to > be very intimidating. But I LOVE Rails. In just a > little over a week of playing around with it, I have > made significant progress on building a custom CRM > solution. To be sure, I have weeks ahead of me to > get a fully functional system. But I know what I > need to do is possible. The Proof of Concept is > complete and it is very true that this framework > allows you to accomplish mor > e with > less code. If you have seen the vTiger interface > then you will know what my CRM solution will look > like. I have plugged Rails into that look and feel > and am making great progress each day. I hope to one > day publish it as open source for others to benefit > from as well. > > > As a bonus, I have a fully functional Asterisk PBX > (open source) managing the phone system. Wow...how > about that? Yes, I will tie it into Ruby or borrow > someone else''s code that has already done it. > > > Thank you David for providing this framework. > Thank you ROR community for providing the kind of > support that you provide to make people like me > willing to take a risk on something that isn''t even > at Release 1.0 yet! > > > Respectfully, > > > Michael > > > > --------------------------------- > Yahoo! FareChase - Search multiple travel sites in > one click. >_______________________________________________> Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >__________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com
CSN wrote:> Huh? I''m not trying to start a flame war. Was an > honest question (and still is) - I don''t know. >Hope so. It does look like an opening round of a classic flame war, when you ask a highly controversial question using an anonymous nick. It''s a big downside of anonymous nicks. Alex
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Nov 13, 2005, at 9:34 PM, Michael wrote:> Thank you David for providing this framework. Thank you ROR > community for providing the kind of support that you provide to > make people like me willing to take a risk on something that isn''t > even at Release 1.0 yet!Welcome to Rails, Michael; it''s great to have you on board! jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (Darwin) iD8DBQFDeCcJAQHALep9HFYRAj6NAJoDvJgu5K6dbCB6AFzW6gn+Z65s2gCfcmdv g+EKnTb287R6HniPTDDF01Q=hSDU -----END PGP SIGNATURE-----
csn, This is probably not a fair question for me to answer. I primarily built b2b apps and line of business apps with .NET using things like remoting, webservices, etc... I like C#. It makes sense to me. But it makes sense because I worked with MS technologies exclusively for a decade. To be quite honest, I have had a little bit of a difficult time picking up Ruby - not quite sure why. I easily learned C#, JavaScript, PHP seemed easy enough, and any other language has been pretty simple. Ruby, though, has me a little stumped at times. It is just different enough from other languages that it forced me to buy a book to understand the diffs between basic things like @, @@, single quote, double quote statements, do, etc..!! :-) It is my own ignorance - not the language itself. Shame on me for thinking I could just look at a few code samples and figure it out. As for rails, I have never had an easier time with data access. The framework of rails is extremely simple...in fact, I don''t know if data access could be any easier than rails makes it. I have never worked with the MVC design pattern before - so I don''t know if it is rails or the pattern - but I love the way the code flows and the way it is separated into the appropriate areas. I like the structure that Rails provides up front. It gives me a great starting point from which I can quickly make changes and add functionality. I worry about performance - but a worry that currently doesn''t have any merit from my perspective. In looking through the log files, I see a lot of SQL statements being generated - which may be okay - or maybe not. I''ll worry about that later. It''s open source, so I can change anything I don''t like! I''m not quite sure the depth of info you are looking for, but I wrote this post because I''m extremely impressed with the framework and the community. Rails will do what I need it to do - and that is the most important thing. More importantly - - - it will do it in a cost effective manner, which is the key to me! I believe this thing is going to take off in a huge way and am happy that I found it when I did. I may be late to the table, but I know I''m still on the ground floor. i.e. - many more will adopt this - just wait and see! I know a good thing when I see it - and this is definitely a good thing! Michael CSN <cool_screen_name90001-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: So you come from .Net/C#? How does Rails/Ruby compare? csn --- Michael wrote:> ROR community, > > > I have been using Rails now for just two weeks. I > am very happy with what I have found and am overly > impressed with the quality and timeliness of > feedback that this community provides. I wanted to > take a moment to explain briefly my background and > how I ended up here. Perhaps this will not be of > personal interest to anyone, but it speaks volumes > about Rails. > > > I have been professionally developing applications > for over 10 years, the last seven of which were done > as an independent consultant. Historically, I > avoided unix, linux, and anything related like the > plague. Not because it was not good technology, but > because I hid under the Microsoft umbrella. Now I''m > involved with a startup and licensing is a major > issue. It has forced me to step into this vast world > of open source software and allowed me to confront > one of my biggest technical fears and weaknesses > the LAMP stack. > > > Desperately needing an open source CRM solution. > I first found SugarCRM, then I stumbled upon vTiger. > Both had their strengths and their weaknesses. The > major problem, though, was customization. I am not a > PHP programmer but the language seemed simple > enough. However, with both of the above packages, I > found the code to be horribly difficult to follow. I > found single functions containing over 800 lines of > code. After a few weeks of bouncing back and forth > between the two of them, I finally realized I was > dealing with something I didn''t want to deal with. I > quit. > > > I began a new search. Realizing that probably > nothing open source was going to be any better than > what I had already found, I was willing to build > something custom. I figured I would start with bare > bones functionality and enhance as time permitted. I > found ActiveGrid. Something that looks quite > promising, but little/no community to back it. I > downloaded it, played with it a bit and was pretty > happy with what I saw. I ran into a problem...no one > was available to answer it. No community. Just a few > forums that are largely untouched on SourceForge. > Maybe in a year or two it will be where it needs to > be but for now it was just too risky for me to > justify. > > > Ruby on Rails kept popping up in various places > forums, blogs, etc... I had never heard of Ruby or > Rails (remember my background). Something caught my > eye somewhere and led me down this path. The > community is so strong and that is very impressive > to me. I feel very ignorant to this new world it > is almost like starting over from scratch. BizTalk, > C#, ASP.NET, WebServices, XML, XSLT, VB, COM/DCOM, > SQL, etc... - no problem. I have been very isolated > to the Microsoft world. I must say that I find all > the different terminology, applications, mechanisms > for updates, etc... in the open source community to > be very intimidating. But I LOVE Rails. In just a > little over a week of playing around with it, I have > made significant progress on building a custom CRM > solution. To be sure, I have weeks ahead of me to > get a fully functional system. But I know what I > need to do is possible. The Proof of Concept is > complete and it is very true that this framework > allows you to accomplish mor > e with > less code. If you have seen the vTiger interface > then you will know what my CRM solution will look > like. I have plugged Rails into that look and feel > and am making great progress each day. I hope to one > day publish it as open source for others to benefit > from as well. > > > As a bonus, I have a fully functional Asterisk PBX > (open source) managing the phone system. Wow...how > about that? Yes, I will tie it into Ruby or borrow > someone else''s code that has already done it. > > > Thank you David for providing this framework. > Thank you ROR community for providing the kind of > support that you provide to make people like me > willing to take a risk on something that isn''t even > at Release 1.0 yet! > > > Respectfully, > > > Michael > > > > --------------------------------- > Yahoo! FareChase - Search multiple travel sites in > one click. >_______________________________________________> Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >__________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Yahoo! FareChase - Search multiple travel sites in one click. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
> This is probably not a fair question for me toanswer. I primarily built b2b> apps and line of business apps with .NET usingthings like remoting,> webservices, etc... I like C#. It makes sense tome. But it makes sense> because I worked with MS technologies exclusivelyfor a decade. To be quite> honest, I have had a little bit of a difficult timepicking up Ruby - not quite> sure why. I easily learned C#, _JavaScript, PHPseemed easy enough, and any> other language has been pretty simple. Ruby,though, has me a little stumped at> times. It is just different enough from otherlanguages that it forced me to> buy a book to understand the diffs between basicthings like @, @@, single> quote, double quote statements, do, etc..!! :-) Itis my own ignorance - not> the language itself. Shame on me for thinking Icould just look at a few code> samples and figure it out.I was just curious what Ruby/Rails offers/lacks comparatively. C#/.Net seems pretty nice, but I don''t think I''d want to buy into MS. I played around with Mono a while ago - I''d probably go with it instead (not that I''m planning to). Ruby looked kind of strange to me at first - methods with ?''s, blocks with |''s, words like ''yield'', Perl-like vars like @_ that I hate, etc. But it''s becoming rapidly familiar to me (after about 1.5 weeks now) - and I think I actually like it. This online book seems to explain everything: http://www.rubycentral.com/book/ csn __________________________________ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs
Huh? I''m not trying to start a flame war. Was an honest question (and still is) - I don''t know. csn --- Alexey Verkhovsky <alex-vV7tgcE2N9Nhl2p70BpVqQ@public.gmane.org> wrote:> CSN wrote: > > So you come from .Net/C#? How does Rails/Ruby > compare? > > > I just about started to write an opinion, when I > looked at who is > asking. cool_screen_name9001-/E1597aS9LQAvxtiuMwx3w@public.gmane.org > Hmm... Good old Ruby vs. Python flame war, anyone? > > .NET is GREAT for anyone who likes drawing web forms > in a visual > designer and creating code with GUI wizards. I doubt > you will find > adepts of this method on the Rails list. However, > there are quite a few > in real life, so it certainly has its target > audience. Let''s leave it at > that. > > Alex > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >__________________________________ Yahoo! Mail - PC Magazine Editors'' Choice 2005 http://mail.yahoo.com
Hhhhmmm.... Darn...I paid 45 bucks for the printed version! But, I did get version 2! It''s good too! :-) Michael CSN <cool_screen_name90001-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > This is probably not a fair question for me to answer. I primarily built b2b> apps and line of business apps with .NET usingthings like remoting,> webservices, etc... I like C#. It makes sense tome. But it makes sense> because I worked with MS technologies exclusivelyfor a decade. To be quite> honest, I have had a little bit of a difficult timepicking up Ruby - not quite> sure why. I easily learned C#, _JavaScript, PHPseemed easy enough, and any> other language has been pretty simple. Ruby,though, has me a little stumped at> times. It is just different enough from otherlanguages that it forced me to> buy a book to understand the diffs between basicthings like @, @@, single> quote, double quote statements, do, etc..!! :-) Itis my own ignorance - not> the language itself. Shame on me for thinking Icould just look at a few code> samples and figure it out.I was just curious what Ruby/Rails offers/lacks comparatively. C#/.Net seems pretty nice, but I don''t think I''d want to buy into MS. I played around with Mono a while ago - I''d probably go with it instead (not that I''m planning to). Ruby looked kind of strange to me at first - methods with ?''s, blocks with |''s, words like ''yield'', Perl-like vars like @_ that I hate, etc. But it''s becoming rapidly familiar to me (after about 1.5 weeks now) - and I think I actually like it. This online book seems to explain everything: http://www.rubycentral.com/book/ csn __________________________________ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Yahoo! FareChase - Search multiple travel sites in one click. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 14.11.2005, at 9.05, Michael wrote:> Hhhhmmm.... Darn...I paid 45 bucks for the printed version! But, I > did get version 2! It''s good too! :-)Don''t be sorry. Ruby has evolved leaps since the version 1.0 and if you plan to do any serious development on it, you want to have the second edition. Plus, you''re supporting a good cause. Now, if you already didn''t, go buy the Rails book, too :-) //jarkko -- Jarkko Laine http://jlaine.net http://odesign.fi _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Heya :)> -----Original Message----- > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of > Alexey Verkhovsky > Sent: Monday, November 14, 2005 12:42 AM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: Re: [Rails] Ruby on Rails... > > .NET is GREAT for anyone who likes drawing web forms in a > visual designer and creating code with GUI wizards. I doubt > you will find adepts of this method on the Rails list. > However, there are quite a few in real life, so it certainly > has its target audience. Let''s leave it at that.]Of course .NET also happens to be a great, fast and powerful environment that supports a variety of languages and development technologies. It can be used for far, far more than web forms as well. While I am all for not having a Ruby vs. .NET flame war (especially as the conclusion on this list of foregone) but we could at least try to be a little bit more accurate :) Soulhuntre ---------- http://www.girl2.com - my girls http://www.the-estate.com - my legacy http://wiki.thegreybook.com - my project http://weblog.soulhuntre.com - my thoughts