<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.lang.ruby.rails">
    <title>gmane.comp.lang.ruby.rails</title>
    <link>http://blog.gmane.org/gmane.comp.lang.ruby.rails</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309144"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309138"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309133"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309125"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309120"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309119"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309118"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309116"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309111"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309104"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309100"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309099"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309098"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309097"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309096"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309095"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309093"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309090"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309089"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309088"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309144">
    <title>error in "each" method in following code.</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309144</link>
    <description>&lt;pre&gt;require 'rubygems'
require 'nokogiri'
require 'sqlite3'

FIELD_NAMES = [['selectcity', 'VARCHAR'],['match', 'VARCHAR'],
['phone_no', 'NUMERIC'], ['name', 'VARCHAR'],['address', 'VARCHAR'] ]

TABLE_DIV_ID = "#dgrSearch"
OFILE = File.open('data-hold/tel-directory.txt', 'w')
OFILE.puts( FIELD_NAMES.map{|f| f[0]}.join("\t") )

DBNAME = "data-hold/tel-directory.sqlite"
File.delete(DBNAME) if File.exists?DBNAME
DB = SQLite3::Database.new( DBNAME )

TABLE_NAME = "telephone_records"
DB_INSERT_STATEMENT = "INSERT into #{TABLE_NAME} values
  (#{FIELD_NAMES.map{'?'}.join(',')})"

DB.execute "CREATE TABLE #{TABLE_NAME}(#{FIELD_NAMES.map{|f| "`#{f[0]}`
#{f[1]}"}.join(', ')});"
FIELD_NAMES.each do |fn|
  DB.execute "CREATE INDEX #{fn[2]} ON #{TABLE_NAME}(#{fn[0]})" unless
fn[2].nil?
end

Dir.glob("data-hold/pages/*.html").reject{|f| f =~ /All match/}.each do
|fname|
   meta_info = File.basename(fname, '.html').split('--')
   page = Nokogiri::HTML(open(fname))

page.css("#{TABLE_DIV_ID} tr")[1..-2].each do |tr|
      data_tds = tr.css('td').map{ |td|
         td.text.gsub(/[$,](?=\d)/, '').gsub(/\302\240|\s/, ' ').strip
      }

data_row = meta_info + data_tds
      OFILE.puts( data_row.join("\t"))
      DB.execute(DB_INSERT_STATEMENT, data_row)

 end
end

OFILE.close

&lt;/pre&gt;</description>
    <dc:creator>Prajwal B.</dc:creator>
    <dc:date>2012-05-26T15:46:10</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309138">
    <title>gemlock and rails version</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309138</link>
    <description>&lt;pre&gt;Trying to understand how the version of rails is handled in the gem file,
if you do:

gem "rails"

and call bundle, it from what I understand will pull down the latest stable
release right?


And then a gemlock file is created, which will contain the version number
so any future calls to bundle will get the same version (it will just be
ignored).

So if you want to upgrade you have to delete the gemlock line with rails
right?

&lt;/pre&gt;</description>
    <dc:creator>S Ahmed</dc:creator>
    <dc:date>2012-05-26T00:20:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309133">
    <title>Can't get css to load in rails 3.2.3 development</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309133</link>
    <description>&lt;pre&gt;Hello all,

I have been struggling all day with getting css files to load in my 
application. I am attempting to use the rails-ui-themes gem to help style 
my application but right now just getting simple css code to render is not 
working. 

I have tried removing the require_tree and including the file individually 
and it still does not seem to work.  When I look at the source of my html, 
every css file is loaded including the application.css file but nothing 
seems to happen.

I was wondering if anyone can tell me what I am missing. 

At this moment here is what I have as my configuration:

app/assets/stylesheets/application.css:

 *= require_self
 *= require_tree .
 *= require jquery-ui/overcast

layouts/application.html.erb:

  &amp;lt;%= stylesheet_link_tag    "application", :media =&amp;gt; "all" %&amp;gt;
  &amp;lt;%= javascript_include_tag "application" %&amp;gt;

some css I have tried to render:
&amp;lt;div class='ui-corner-all'&amp;gt;
.....
&amp;lt;/div&amp;gt;

or 

&amp;lt;div id='user_nav'&amp;gt;
....
&amp;lt;/div&amp;gt;

The simple css that I tried to render is

#user_nav{
float: right;
font-size: 12px;
}

&lt;/pre&gt;</description>
    <dc:creator>Vell</dc:creator>
    <dc:date>2012-05-25T21:57:04</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309125">
    <title>Connect reset by peer error</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309125</link>
    <description>&lt;pre&gt;

Hi all

I'm getting a 'Connection reset by peer' while getting an access token during oAuth from a third party API. Here's the code snippet: 

def accesstoken
  &amp;lt; at &amp;gt;code = params[:code]
   
   url = URI.parse('access token request url')
   req = Net::HTTP::Post.new(url.path)
   req.set_form_data({'auth_code' =&amp;gt; &amp;lt; at &amp;gt;code, 'client_id'=&amp;gt;'my_client_id', 'client_secret'=&amp;gt;'my_secret_key'}, ';')
   res = Net::HTTP.new(url.host, url.port).start { |http| http.request(req) }
   case res
   when Net::HTTPSuccess, Net::HTTPRedirection
      # OK
    else
     # res.error!
    end

    render :text =&amp;gt; &amp;lt; at &amp;gt;code.inspect

end

I get a valid authorization code but unable to proceed to get access token due to above error. The third party API has to return a response in json format.
Any help is much awaited and appreciated!

&lt;/pre&gt;</description>
    <dc:creator>iDev</dc:creator>
    <dc:date>2012-05-25T10:38:04</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309120">
    <title>Custom sort scope for ActiveRecord search</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309120</link>
    <description>&lt;pre&gt;Hi,

Here is my problem. I store some of my data in a MYSQL DB and some of it in 
Redis. In my search I need to be able to combine results from both. 
Right now my code looks like this:
scope = User.scoped({})
cope = scope.where("users.gender = ?", gender)
cope = scope.where("users.age = ?", age)
etc.. 
I want to take the result and either sort it using the data that's in 
Redis. It is possible do create a scope for that? 
The best I could come up with was users = User.search().sort_by {|user| 
...} . The problem with is is that it returns an array instead of an active 
record  associations, so now pagination doesn't work. 

Regards,
Eugene 

&lt;/pre&gt;</description>
    <dc:creator>eugene miretsky</dc:creator>
    <dc:date>2012-05-25T07:48:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309119">
    <title>create folders and files through linux system commands in rails application</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309119</link>
    <description>&lt;pre&gt;Hi,

can anyone suggest me how to create folders and files through linux system
commands in rails application and to provide drag and drop support to them


Thanks,
Rajesh

&lt;/pre&gt;</description>
    <dc:creator>Rajesh Reddy</dc:creator>
    <dc:date>2012-05-25T06:52:10</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309118">
    <title>Problems working through Railstutorial.org tutorials</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309118</link>
    <description>&lt;pre&gt;I'm having trouble replicating the results of this tutorial (
http://ruby.railstutorial.org/chapters/filling-in-the-layout#top ),
namely making Bootstrap gem work (section 5.1.2). I couldn’t find any
existing issues on its Github page, and I can’t trace additional error
messages that would be helpful to solving this problem. I'm lost at
the point where I don't even know what printouts or files I should
include to ask for help on the problem (I walked through some trials
with the folks on IRC and there were still a lot of possibilities of
where it could've gone wrong). I wonder if there are any RoR folks in
this message board who's located in Vancouver, BC. I'd be happy and
willing to compensate accordingly for your time helping me. Please
respond if you're located there and interested in this offer.

Thanks in advance!

&lt;/pre&gt;</description>
    <dc:creator>Stanley Lee</dc:creator>
    <dc:date>2012-05-25T05:44:44</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309116">
    <title>Freelance Ruby Developer For Hire</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309116</link>
    <description>&lt;pre&gt;Hi All,

I am a Ruby Developer... I am looking for a new ROR (sub)
contract/freelance role.

In my last contract i actively contributed to the web project and using
Rails, Postgresql, CoffeeScript, jQuery, TDD/BDD based testing with Ruby
(RSpec, Cucumber, Capybara) libraries to develop web applications.

I am available for an immediate start.

Thanks
--

Ikenna


---------- Forwarded message ----------
From: Phil Crissman &amp;lt;phil.crissman-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Date: Thu, May 24, 2012 at 11:40 PM
Subject: Re: [Rails] Help with inserting multiple records via console
To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw&amp;lt; at &amp;gt;public.gmane.org


Not exactly, you could create an array of params hashes and iterate over
it. Using your example, it would be something like:

[{:title =&amp;gt; "Test title 1", :body =&amp;gt; "Test body text 1, ..", :published_at
=&amp;gt; Date.today}, {:title =&amp;gt; "Test title 2", :body =&amp;gt; "Test body text 2..",
:published_at =&amp;gt; Date.today}].each{ |params| Article.create(params) }

At some point you might want to look into gems like factory_girl; usually
used for testing, but could also be used to seed a development environment
with a little more convenience.

Phil



On Wed, May 23, 2012 at 7:54 PM, captain awesome &amp;lt;
mr.captain.awesome-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:


 --
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0&amp;lt; at &amp;gt;public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0&amp;lt; at &amp;gt;public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

&lt;/pre&gt;</description>
    <dc:creator>Okpala Ikenna N.</dc:creator>
    <dc:date>2012-05-24T23:48:37</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309111">
    <title>Updating attribute on dependent of many-to-on association</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309111</link>
    <description>&lt;pre&gt;All,

I posted this over on comp.lang.ruby, but realized I should probably
keep Rails questions to this group, so soory for the cross-post.

I have a rails app with a Transaction class that has_many :entries.
Each Transaction has many entries, and those with the debit attribute
true are debits, false are credits.  It starts like this.

class Transaction &amp;lt; ActiveRecord::Base
  has_many :entries
  has_many :debits, :class_name =&amp;gt; 'Entry', :conditions =&amp;gt; {:debit =&amp;gt;
true}
  has_many :credits, :class_name =&amp;gt; 'Entry', :conditions =&amp;gt; {:debit =&amp;gt;
false}
end

I want to be able to complete an Transaction if there is exactly one
Entry that has its amount set to nil.  I want to set that amount to a
debit or credit of the proper amount to make the Transaction balance.

Sounded easy to me, but I am having trouble with my balance! method.
The relevant part of it is:

  def balance!
    ...
    if num_nils == 1
      # Set the sole nil entry to amount needed to balance Transaction
      plug = debit_total - credit_total
      entries.where(:amount =&amp;gt; nil).each do |e|
        e.amount = plug.abs
        e.debit = (plug &amp;lt; 0)
        e.save
      end
    end

The problem is that when I finish this, the entries associated with my
Transaction are not affected.  I appears to make a copy, change it,
and
leave the Entry associated with my Transaction with a nil amount.

What am I missing?

Thanks,

Dan Doherty

&lt;/pre&gt;</description>
    <dc:creator>ddoherty03</dc:creator>
    <dc:date>2012-05-25T03:43:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309104">
    <title>Twitter gem user timeline link_to helper for hashes</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309104</link>
    <description>&lt;pre&gt;Hi all,
I just installed the Twitter gem and created a partial where I can publish my latest tweets. Because the output
is plain text I created an application helper which should replace the hash tags into some links.

First of all is this a convenient way or is there even a better solution like build in link to helper or something like that (couldn't find anything so far).

My second question is regards my helper function. I had a solution which was working but the code sucked:


def change_hashes
 hashes = text.scan(/#\d*\w*/)
    hashes.each do |hash|
      text = sanitize(text.gsub(hash, link_to(hash, "https://twitter.com/#!/search/#{hash.sub(/#/, "%23")}")))
    end
    return text
end

So I refactored it into this:

def change_hashes(text)
    text.gsub(/#\d*\w*/) { |s| text.sub(s, link_to(s, "https://twitter.com/#!/search/#{s.sub(/#/, "%23")}")) }
  end

The problem is that if I the tweet contains more than one hash the whole tweet is being duplicated. Maybe someone can pinpoint me into the right direction?


Cheers
Greg

&lt;/pre&gt;</description>
    <dc:creator>Greg</dc:creator>
    <dc:date>2012-05-24T21:45:50</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309100">
    <title>Rails Console Sandbox : .save | .create</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309100</link>
    <description>&lt;pre&gt;At the end of Rails Tutorial chapter 6, I have the
development .sqlite3 db : 1 table and 1 row (= user id:1 see below) :

1.9.3p125 :002 &amp;gt; user1 = User.first

User Load (0.2ms)  SELECT "users".* FROM "users" LIMIT 1
 =&amp;gt; #&amp;lt;User id: 1, name: "Michael Hartl", email: "mhartl-hcDgGtZH8xNBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org",
created_at: "2012-05-22 10:32:16", updated_at: "2012-05-22 10:32:16",
password_digest: "$2a
$10$Eh2xj8CvvKaDFD2uel4LbOQ2dMsCmENy8tyts1BsFzJb..."&amp;gt;

1.9.3p125 :002 &amp;gt; user2 = User.create(name: "Francois DG", email:
"fdg-hcDgGtZH8xNBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org")

  (0.1ms)  SAVEPOINT active_record_1
  User Exists (0.2ms)  SELECT 1 FROM "users" WHERE
LOWER("users"."email") = LOWER('fdg-hcDgGtZH8xNBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org') LIMIT 1
   (0.1ms)  ROLLBACK TO SAVEPOINT active_record_1
 =&amp;gt; #&amp;lt;User id: nil, name: "Francois DG", email: "fdg-hcDgGtZH8xNBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org",
created_at: nil, updated_at: nil, password_digest: nil&amp;gt;

CAN SOMEBODY TELL ME WHY &amp;amp; WHAT TO DO ?

&lt;/pre&gt;</description>
    <dc:creator>Francesco De Grandi</dc:creator>
    <dc:date>2012-05-24T13:58:14</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309099">
    <title>Newbie question - how to resolve 'wrong status line' error</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309099</link>
    <description>&lt;pre&gt;Hi everyone

I'm learning Ruby on Rails and wanted to perform oAuth as follows for
a third party API. But I get an error as follows:

wrong status line: "&amp;lt;!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN
\"&amp;gt;"


//Code snippet
require 'net/https'
require 'uri'

class UsersController &amp;lt; ApplicationController

  def auth
       &amp;lt; at &amp;gt;client_id = params[:client_id]
       &amp;lt; at &amp;gt;auth_url = "https://url/oauth/authorize?
client_id=#{&amp;lt; at &amp;gt;client_id}"
       url = URI.parse(&amp;lt; at &amp;gt;auth_url )
       req = Net::HTTP::Post.new(url.path)
       res = Net::HTTP.start(url.host, url.port) {|http|
http.request(req)}

&amp;lt; at &amp;gt;output = res.body
render :text =&amp;gt; &amp;lt; at &amp;gt;output.inspect

   end

end


Any help to proceed is much appreciated.

&lt;/pre&gt;</description>
    <dc:creator>iDev</dc:creator>
    <dc:date>2012-05-24T10:13:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309098">
    <title>i am getting override method issue in  compute_public_path' for module `ActionView::Helpers::AssetTagHelper'</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309098</link>
    <description>&lt;pre&gt;Hi All,

I am doing migration rails 3.0.5 to 3.2.3 and also changed ruby
versions from 1.8.7 to 1.9.3.

I want override the method
compute_public_path(ActionView::Helpers::AssetTagHelper).


Now i got this  error while migrating the application (3.2.3).

`alias_method': undefined method `compute_public_path' for module
`ActionView::Helpers::AssetTagHelper' (NameError)


Please give me your valuable suggestions the above issue.


I have done small program. it is working perfectly.

class String

    alias_method :old_to_s, :to_s

    def to_s
        if  self=="one"
          "coming if "
        else
         "coming else"
        end

    end


end

str=String.new("one")
p str.to_s

p str.old_to_s




&lt;/pre&gt;</description>
    <dc:creator>Pal Pandi</dc:creator>
    <dc:date>2012-05-24T13:11:19</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309097">
    <title>Ruby on Rails Tutorial Chapter 6 RSpec tests failing</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309097</link>
    <description>&lt;pre&gt;Hello all:

I'm a RoR newbie who is currently following the Ruby on Rails
Tutorial: Learning by Example book (http://ruby.railstutorial.org/
chapters/modeling-users#sec:adding_a_secure_password). The following
Chapter 6 RSpec tests are failing:

Failures:

1) User [31mFailure/Error:[0m [31mit { should be_valid }[0m
[31mexpected valid? to return true, got false[0m [36m # ./spec/models/
user_spec.rb:19:in `block (2 levels) in '[0m

2) User when email format is valid should be valid [31mFailure/Error:
[0m [31m-agIoKRwLymF0sw7Iq073Hg&amp;lt; at &amp;gt;public.gmane.org be_valid[0m [31mexpected valid? to return true,
got false[0m [36m # ./spec/models/user_spec.rb:51:in block (4 levels)
in &amp;lt;top (required)&amp;gt;'[0m [36m # ./spec/models/user_spec.rb:
49:ineach'[0m [36m # ./spec/models/user_spec.rb:49:in `block (3
levels) in '[0m

3) User return value of authenticate method with valid password
[31mFailure/Error:[0m [31mit { should ==
found_user.authenticate(&amp;lt; at &amp;gt;user.password) }[0m [31mNoMethodError:[0m
[31mundefined method authenticate' for nil:NilClass←[0m [36m # ./spec/
models/user_spec.rb:94:inblock (4 levels) in '[0m

4) User return value of authenticate method with invalid password
[31mFailure/Error:[0m [31mlet(:user_for_invalid_password)
{ found_user.authenticate("invalid") }[0m [31mNoMethodError:[0m
[31mundefined method authenticate' for nil:NilClass[0m [36m # ./spec/
models/user_spec.rb:98:inblock (4 levels) in '[0m [36m # ./spec/models/
user_spec.rb:100:in `block (4 levels) in '[0m

5) User return value of authenticate method with invalid password
[31mFailure/Error:[0m [31mlet(:user_for_invalid_password)
{ found_user.authenticate("invalid") }[0m [31mNoMethodError:[0m
[31mundefined method authenticate' for nil:NilClass[0m [36m # ./spec/
models/user_spec.rb:98:inblock (4 levels) in '[0m [36m # ./spec/models/
user_spec.rb:101:in `block (4 levels) in '[0m

Finished in 3.56 seconds [31m20 examples, 5 failures[0m

Failed examples:

[31mrspec ./spec/models/user_spec.rb:19[0m [36m# User [0m [31mrspec ./
spec/models/user_spec.rb:47[0m [36m# User when email format is valid
should be valid←[0m [31mrspec ./spec/models/user_spec.rb:94[0m [36m#
User return value of authenticate method with valid password ←[0m
[31mrspec ./spec/models/user_spec.rb:100[0m [36m# User return value of
authenticate method with invalid password [0m [31mrspec ./spec/models/
user_spec.rb:101[0m [36m# User return value of authenticate method
with invalid password [0m Slave(1) run done!

---------------------------------------------------
Here is the user Model:

class User &amp;lt; ActiveRecord::Base
  attr_accessible :name, :email, :password, :password_confirmation
  attr_accessor :password, :password_confirmation
  has_secure_password

  before_save { |user| user.email = email.downcase }

  validates :name, presence: true, length: { maximum: 50 }
  VALID_EMAIL_REGEX = /\A[\w+\-.]+&amp;lt; at &amp;gt;[a-z\d\-.]+\.[a-z]+\z/i
  validates :email, presence: true, format: { with:
VALID_EMAIL_REGEX },uniqueness: { case_sensitive: false }
  validates :password, presence: true, length: { minimum: 6 }
  validates :password_confirmation, presence: true

---------------------------------------------------
Here is the RSpec model/user_spec.rb:

require 'spec_helper'

describe User do

  before do
    &amp;lt; at &amp;gt;user = User.new(name: "Examplexxx", email: "user-hcDgGtZH8xNBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org",
                     password: "foobar", password_confirmation:
"foobar")
  end

  subject { &amp;lt; at &amp;gt;user }

  it { should respond_to(:name) }
  it { should respond_to(:email) }
  it { should respond_to(:password_digest) }
  it { should respond_to(:password) }
  it { should respond_to(:password_confirmation) }
  it { should respond_to(:authenticate) }

  it { should be_valid }

  describe "when name is not present" do
    before { &amp;lt; at &amp;gt;user.name = " " }
    it { should_not be_valid }
  end

  describe "when email is not present" do
    before { &amp;lt; at &amp;gt;user.email = " " }
    it { should_not be_valid }
  end

  describe "when name is longer than 50 characters" do
    before { &amp;lt; at &amp;gt;user.name = "a" * 51 }
    it { should_not be_valid }
  end

  describe "when email format is invalid" do
    it "should be invalid" do
      addresses = %w[user&amp;lt; at &amp;gt;foo, com user_at_foo.org example.user&amp;lt; at &amp;gt;foo.
foo&amp;lt; at &amp;gt;bar_baz.com foo&amp;lt; at &amp;gt;bar+baz.com]
      addresses.each do |invalid_address|
        &amp;lt; at &amp;gt;user.email = invalid_address
        &amp;lt; at &amp;gt;user.should_not be_valid
      end
    end
  end

  describe "when email format is valid" do
    it "should be valid" do
      addresses = %w[user-aYmlcMoNXFo&amp;lt; at &amp;gt;public.gmane.org A_US-ER&amp;lt; at &amp;gt;f.b.org frst.lst-CfcPUM2A7yk&amp;lt; at &amp;gt;public.gmane.org a
+b&amp;lt; at &amp;gt;baz.cn]
      addresses.each do |valid_address|
        &amp;lt; at &amp;gt;user.email = valid_address
        &amp;lt; at &amp;gt;user.should be_valid
      end
    end
  end

  describe "when email address is already taken" do
    before do
      user_with_same_email = &amp;lt; at &amp;gt;user.dup
      user_with_same_email.email = &amp;lt; at &amp;gt;user.email.upcase
      user_with_same_email.save
    end

    it { should_not be_valid }
  end

  describe "when password is not present" do
    before { &amp;lt; at &amp;gt;user.password = &amp;lt; at &amp;gt;user.password_confirmation = " " }
    it { should_not be_valid }
  end

  describe "when password doesn't match confirmation" do
    before { &amp;lt; at &amp;gt;user.password_confirmation = "mismatch" }
    it { should_not be_valid }
  end


  describe "When password confirmation is nil" do
    before { &amp;lt; at &amp;gt;user.password_confirmation = nil }
    it { should_not be_valid }
  end

  describe "with a password that's too short" do
    before { &amp;lt; at &amp;gt;user.password = &amp;lt; at &amp;gt;user.password_confirmation = "a" * 5 }
    it { should_not be_valid }
  end

  describe "return value of authenticate method" do
    before { &amp;lt; at &amp;gt;user.save }
    let(:found_user) { User.find_by_email(&amp;lt; at &amp;gt;user.email) }

    describe "with valid password" do
      it { should == found_user.authenticate(&amp;lt; at &amp;gt;user.password) }
    end

    describe "with invalid password" do
      let(:user_for_invalid_password)
{ found_user.authenticate("invalid") }

      it { should_not == user_for_invalid_password }
      specify { user_for_invalid_password.should be_false }
    end
  end

end

-------------------------------------------------

Here is my gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.3'
gem 'bootstrap-sass', '2.0.0'
gem 'bcrypt-ruby', '3.0.1'

group :development, :test do
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.9.0'
  gem 'spork'
  gem 'webrat'
end

gem 'jquery-rails', '2.0.0'

group :test do
    gem 'capybara', '1.1.2'
end


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~&amp;gt; 3.2.3'
  gem 'coffee-rails', '~&amp;gt; 3.2.2'
  gem 'uglifier', '&amp;gt;= 1.0.3'
end

Thank you so much for your help! Neo Ramos

&lt;/pre&gt;</description>
    <dc:creator>Neo</dc:creator>
    <dc:date>2012-05-24T00:56:31</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309096">
    <title>Help with inserting multiple records via console</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309096</link>
    <description>&lt;pre&gt;I'm fairly new to Rails and was wondering would it be possible to insert 
multiple records via the console?

I tried variations along the lines of this but all failed.
Article.create {:title =&amp;gt; "Test title 1", :body =&amp;gt; "Test body text 1, ..", 
:published_at =&amp;gt; Date.today} {:title =&amp;gt; "Test title 2", :body =&amp;gt; "Test body 
text 2..", :published_at =&amp;gt; Date.today}

If this is possible, please help.

Thank you

&lt;/pre&gt;</description>
    <dc:creator>captain awesome</dc:creator>
    <dc:date>2012-05-24T00:54:31</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309095">
    <title>rake error</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309095</link>
    <description>&lt;pre&gt;/usr/bin/rake:9:in `require': no such file to load -- rubygems
(LoadError)
        from /usr/bin/rake:9

I got this error when following an online guide in rails, the command
I had to type in was # rake db:create.. after I typed in the command I
got the above error. It's almost 2 days that I'm searching for a
solution to this. But in vain,

Can anyone help me out btw I'm a rookie in RoR

&lt;/pre&gt;</description>
    <dc:creator>Meow san</dc:creator>
    <dc:date>2012-05-23T19:29:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309093">
    <title>Declaring list of string constnats for app</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309093</link>
    <description>&lt;pre&gt;Hi All,

I'm building an app that compares statistics from sports games. Each
statistic has an "action" that defines what happened at that point in
time, for example "player has possession" is one such action string.

I use these strings to pull out / sort the statistics into meaningful
information, so these strings are used throughout the app.

I want to know a good place to have a list of global variables like
this. I have tried :

creating file called action_string_constants.rb in /lib.
In this file I declare a module :
module  ActionStringConstants

  MB_ACTION_STRING_PLAYER_HAS_POSSESSION = "player has posession"

end

I then try and use this in another class such as Player (model) with

include ActionStringConstants

However this returns a NameError (uninitialized constant
Player::ActionStringConstants):


I then thought of including this in application.rb, as I want to use
these constants in many files, but this returns a similar error when
trying to launch the app.

Where can I declare a string constant??!

This really should be simple!

&lt;/pre&gt;</description>
    <dc:creator>Michael Baldock</dc:creator>
    <dc:date>2012-05-24T15:05:20</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309090">
    <title>Heroku Deploy - assets issue_paperclip</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309090</link>
    <description>&lt;pre&gt;Hi all, I'm deploying my app on heroku for tests and have noticed
something odd.

I'm rails 3.2.3 and paperclip do handle the displaying/uploading images
process.
Everything runs smooth on my localhost but on Heroku, if I upload a
picture and the App isn't "accessed" for like during the night, in the
morning the image is not there and the 'broken image icon' takes its
place.

If I re-add the image and keep accessing the website for like, every
hour, everything is fine and all the images are there.

It's worth mentioning that I'm saving my images in paperclip's default
path, in the public-&amp;gt;assets folder. And for testing, I wanted to keep it
that way.

Will this issue go away if I set the path to my app-&amp;gt;assets folder?

Or does this have anything to do with the inner workings of Heroku,
assigning one dyno and then idling after some time with no hits, and
when the application "wakes up again" another dyno is assigned and the
app loses its uploaded images?

Is storing in Amazon S3 the only way of solving this or does altering
the path of paperclip to the App folder solves the problem?
If so, will it be a reliable option for a production stage?

Thank in advance for enlightening a RoR beginner,

Regards

&lt;/pre&gt;</description>
    <dc:creator>Miguel A.</dc:creator>
    <dc:date>2012-05-24T14:10:47</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309089">
    <title>Errors and flash[:error]</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309089</link>
    <description>&lt;pre&gt;What is the relationship, if any, between the errors array for one of
my models and flash[:error]? Are validation errors automatically added
to the flash? Is there a helper I can use in my view to merge the
results?

Situation:

I provide a form, of sorts, for creating HABTM relationships between
two other models. The HABTM model does a bunch of validation to make
sure it won't save an invalid record. Additionally, each of the models
being associated has an "owner" and I need to verify in my controller
that the owner matches my session data to prevent somebody from
creating associations on someone else's behalf.

I'd like to provide a bullet list of the combined results of
validation errors and session matching errors.

The UI on my form should prevent both types of errors. So from the end
user's perspective there is no meaningful difference.

&lt;/pre&gt;</description>
    <dc:creator>Brian</dc:creator>
    <dc:date>2012-05-24T13:35:16</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309088">
    <title>Migrating App From 3.0 to 3.2.3 with ruby 1.9.3</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309088</link>
    <description>&lt;pre&gt;Hi Team,

    I have an Issue in migrating my app ProductList from rails 3.0 to
Rails 3.2.3 with Ruby  1.9.3

 I faced a lot of issues still I hope for the best, Is there any way
to configure the existing app .


I have made changes in gemfile, public folder moved to assets , plugin
moved to lib

Thanks In advance

Swords Community

&lt;/pre&gt;</description>
    <dc:creator>The Rising Sword</dc:creator>
    <dc:date>2012-05-24T13:10:32</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails/309087">
    <title>The Usage of .except in Query</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails/309087</link>
    <description>&lt;pre&gt;Hi every body...
please look at the below queries...

Both the queries will give same result. If then; the use of .except here
is needless.


My question is that where that(.except) could be more useful. can u
please explain me a context for that.

&lt;/pre&gt;</description>
    <dc:creator>victor Arul</dc:creator>
    <dc:date>2012-05-24T12:41:35</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.ruby.rails">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lang.ruby.rails</link>
  </textinput>
</rdf:RDF>

