::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
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
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
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
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
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"
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
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
8 matches
Mail list logo