Re: [Rails] Help with find

2012-05-18 Thread Fernando Almeida
Person.where.limit returns a collection, you can to use .first, .last, .each. etc to access the element(s) or you can to use Person.find(34) in this case. 2012/5/18 brent brent > Folks > When im in rails 3.2 console i can do this just fine > > p = Person.last > p.last_name > > and it prints

[Rails] Help with find

2012-05-18 Thread brent brent
Folks When im in rails 3.2 console i can do this just fine p = Person.last p.last_name and it prints the last name. But when i try to find it by the id, its able to locate the single record and store it in my variable p, but i cant print the last_name column. For example. p = Pers

Re: [Rails] Proxy Model Class

2012-05-18 Thread Jeremy Walker
On 19 May 2012 00:28, mengu wrote: > hello everyone, > > is it possible to instantiate a model class with it's id instead of > pulling it from the db? > SomeObject obj = SomeObject.new obj.id = 10 Is that what you mean? What's your use-case for this? > > thanks in advance. > > -- > You receiv

[Rails] Proxy Model Class

2012-05-18 Thread mengu
hello everyone, is it possible to instantiate a model class with it's id instead of pulling it from the db? thanks in advance. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googleg

Re: [Rails] Chain scopes with OR

2012-05-18 Thread azizmb.in
To add to that, if you want to construct complex queries, you should have a look at arel . On Sat, May 19, 2012 at 12:17 AM, azizmb.in wrote: > AFAIK, something like this should work: > > def find_visibles > find_in_coverage | find_known_missing > end > > > On

Re: [Rails] Re: Spell checker for ror

2012-05-18 Thread azizmb.in
So are you looking for a solution in javascript or ruby/rails or both? On Fri, May 18, 2012 at 9:57 AM, Swati Verma wrote: > I want javascript spell checker which check spellings in html form. > > > On Thursday, 17 May 2012 16:14:30 UTC+5:30, Swati Verma wrote: >> >> Please tell me good spell che

Re: [Rails] Chain scopes with OR

2012-05-18 Thread azizmb.in
AFAIK, something like this should work: def find_visibles find_in_coverage | find_known_missing end On Fri, May 18, 2012 at 10:53 PM, Gustavo de Sá Carvalho Honorato < gustavohonor...@gmail.com> wrote: > Hi all! > > I've googled all over and I couldn't find anything about chaining scopes > w

Re: [Rails] Re: Ror code please just help me in findng solution

2012-05-18 Thread azizmb.in
HI Prajwal I can see that you are aware of www.google.com, please consider using it. On Fri, May 18, 2012 at 7:09 PM, Prajwal B. wrote: > hello, >could i just know where and how to define a mechanize action for > page consider http://www.google.com in my rails app. > > -- > Posted via h

Re: [Rails] Ideas For Handling Rake Task Errors

2012-05-18 Thread Hassan Schroeder
On Thu, May 17, 2012 at 10:24 PM, gerbdla wrote: > I am looking for some ideas on how I can create some way of error > alerts for failed rake tasks and how some of you are handling > something like this.  Basically if a rake tasks fails I would like to > have some kind of alert by email that the t

[Rails] Chain scopes with OR

2012-05-18 Thread Gustavo de Sá Carvalho Honorato
Hi all! I've googled all over and I couldn't find anything about chaining scopes with OR instead of the default AND. I have an Asset model with the following scopes: class Asset < ActiveRecord::Base (...) scope :find_in_coverage, lambda { where('timestamp(assets.found_at) >= ?', Asset.found_

[Rails] Re: Ideas For Handling Rake Task Errors

2012-05-18 Thread Luis Lavena
Hello, On Friday, May 18, 2012 2:24:19 AM UTC-3, gerbdla wrote: > > I am looking for some ideas on how I can create some way of error > alerts for failed rake tasks and how some of you are handling > something like this. Basically if a rake tasks fails I would like to > have some kind of alert

[Rails] Error installing therubyracer

2012-05-18 Thread tfp44
I'm struggling to install therubyracer gem. Using CentOS 6.2 x86_64, ruby 1.9.3p194, gem 1.8.24, libv8 (3.10.8.0, 3.3.10.4 x86_64-linux) Trying to install therubyracer gives me: Building native extensions. This could take a while... ERROR: Error installing therubyracer: ERROR: Failed to

[Rails] Re: Ror code please just help me in findng solution

2012-05-18 Thread Prajwal B.
hello, could i just know where and how to define a mechanize action for page consider http://www.google.com in my rails app. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to t

[Rails] Re: Connecting rails to a semantic RDF web database?

2012-05-18 Thread vierundsech...@googlemail.com
You probably want to get in contact with Greg Kellog (https://github.com/gkellogg), who very actively maintains the ruby-rdf-projects: Check out his github-account, he has just recently moved several rdf-related projects(including sparql, https://github.com/gkellogg/sparql, which contains a cli

[Rails] Re: Spell checker for ror

2012-05-18 Thread Swati Verma
I want javascript spell checker which check spellings in html form. On Thursday, 17 May 2012 16:14:30 UTC+5:30, Swati Verma wrote: > > Please tell me good spell checker in rails. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view t

Re: [Rails] Re: Can't mass-assign these protected attributes?

2012-05-18 Thread Jeremy Walker
On 17 May 2012 22:56, David D. wrote: > I have found a solution to this problem (solution is geared for the > newest version of rails etc, as of mid May 2012) > > If you are simply doing early stage development stuff, you do not need > the extra feature which blocks mass assignment. The thing

Re: [Rails] is it a nested has_many :through association?

2012-05-18 Thread Gautam Rege
>From what I gather, profiles should be the :through relation! class Company < ActiveRecord::Base has_many :profiles has_many :managers, :through => :profiles end class Manager < ActiveRecord::Base has_many :profiles has_many :companies, :through => :profiles end class Profile < ActiveRe

[Rails] is it a nested has_many :through association?

2012-05-18 Thread Mauro
I have: Manager has_many :companies has_many :profiles Company has_many :managers Profile has_many :managers I want to assign on or more profiles to every Manager-Company I'm trying: Manager has_many :managements has_many :companies, :through => :managements has_many :profiles, :through => :ma

Re: [Rails] can someone explain how map! / connect! works in this case?

2012-05-18 Thread Michael Pavling
On 18 May 2012 04:57, Christopher D. wrote: > ary = [0,1,1,1,1,3] > ary.map! { |num| %w(zero one two three)[num] } > > I just don't get it, how does it know which value to write out? you're taking the numbers 0,1,1,1,1,3 and for each of them you're populating an array with the values from another

[Rails] 33% off live Rails training

2012-05-18 Thread Brook R.
Heyo! Learning Rails is hard, so I made a workshop... The discount code MISTAKES will get you a huge 33% off the live & online Rails Fundamentals Workshop: http://readysetrails.com It's a great way to "get over the learning curve" by interacting with live instructors (as opposed to a screencast