[Rails] Re: ActiveRecord::Base

2014-07-15 Thread Eugene Gilburg
::String means explicit root namespace. So if you have something like module MyNamespace class String ... end end MyNamespace::String will be your own class, while ::String will still be the original string class defined by Ruby. If you just type String, it'll find the closest matching

[Rails] Re: ActiveRecord::Base

2014-07-15 Thread Mateusz Dw
Good question! Using :: you have access to the class inside the module. Module can nest another modules and so on. :: its a namespace resolution operator. Call ::String.new inside some module back you to top-level namespace (outside the module) Here is examples class String def initialize p

[Rails] Re: ActiveRecord::Base -> what does it mean?

2009-06-09 Thread tivrfoa
Thanks a lot Rick! On Jun 9, 1:03 pm, Rick DeNatale wrote: > On Tue, Jun 9, 2009 at 11:45 AM, tivrfoa wrote: > > > Hi folks! > > > I just want to know the name of the relationship between ActiveRecord > > and Base. > > > Thanks!!! > > ActiveRecord is a global which refers to a Ruby module. One

[Rails] Re: ActiveRecord::Base -> what does it mean?

2009-06-09 Thread Rick DeNatale
On Tue, Jun 9, 2009 at 11:45 AM, tivrfoa wrote: > > Hi folks! > > I just want to know the name of the relationship between ActiveRecord > and Base. > > Thanks!!! ActiveRecord is a global which refers to a Ruby module. One of the functions of a module in Ruby is to define a name space. ActiveReco

[Rails] Re: ActiveRecord::Base

2009-03-06 Thread Lubomir Herko
Frederick Cheung wrote: > On 6 Mar 2009, at 18:26, Lubomir Herko wrote: > >> >> Why this doesn't work? >> >> ActiveRecord::Base.connection.execute("\\d") ? >> > Because you're confusing commands the the psql application supports > versus actual sql queries you can run. Execute lets you run arbitr

[Rails] Re: ActiveRecord::Base

2009-03-06 Thread Frederick Cheung
On 6 Mar 2009, at 18:26, Lubomir Herko wrote: > > Why this doesn't work? > > ActiveRecord::Base.connection.execute("\\d") ? > Because you're confusing commands the the psql application supports versus actual sql queries you can run. Execute lets you run arbitrary sql expressions, which "\\d"

[Rails] Re: ActiveRecord::Base class considered as module

2009-01-26 Thread Rob Biedenharn
On Jan 26, 2009, at 5:35 AM, jney wrote: > Hello, > > I'm trying to upgrade a rails app with an old frozen rails version > (1.1.6). > I got an error each time i'm calling an active record model because it > considers it as a module. > > anyone got an idea how to fix it? The client that I had wi

[Rails] Re: ActiveRecord::Base in environment.rb

2009-01-15 Thread MaD
obviously you want to mix in the module Searchable into your ActiveRecord::Base. by using extend the methods inside the Searchable- module become class methods (with "include" they would become instance methods). > My question is why do we define such a class in environment.rb > What is the actua