Ruby on Rails Saturday, December 1, 2012

On Dec 1, 11:40 am, Jordon Bedwell <envyge...@gmail.com> wrote:
> On Sat, Dec 1, 2012 at 9:29 AM, Frederick Cheung
>
> <frederick.che...@gmail.com> wrote:
> > Rails doesn't use rspec. It uses minitest (which is what test::unit is
> > on 1.9). I don't think it has an equivalent fail fast option although
> > there do appear to be some monkey patches floating around
>
> What has what Rails uses to do with what you use personally?

Because it looks to me like they are trying to run the active record
test suite against their database driver (the schema used in the error
messages matches one of the tables used in the active record tests.

 Fred

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 1 December 2012 12:36, mukul saharia <mukul.saharia@gmail.com> wrote:
> hello friend,
> i want to use all my pictures which i uploaded on flickr. i dnt want to
> upload again pics to my application database i want to use all of them
> directly from flickr. how it is possible on rails.

google for
ruby rails flickr

I cannot understand why you did not do that before asking here.

Colin

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 1 December 2012 14:08, sakthivel sekar <sakthivelsekar33@gmail.com> wrote:
> Hi,
> I have two models named Customer and Order.
>
> Customer < ActiveRecord::Base
> has_many :orders
> end
>
> Order < ActiveRecord::Base
> belongs_to :customer
> end
>
> Customer model has attributes like first_name and last_name. Order has
> customer_id along with other attributes.
>
> Now, I want Customer first_name for specific order. I can get it with
> following query.
>
> Customer.joins(:orders).where('orders.id = 1').select('first_name').

You are missing the fundamental nature of ActiveRecord associations.
If you have an order in, for example, @order then the customer is
@order.customer and if you want that customer's first_name then you
can say @order.customer.first_name. There is no need to mess about
with complex queries, such is the magic of Rails.

>
> But, how to get it along with attributes of order table also. Say, I want
> both customers first_name and orders table created_at value.
> When I try,
> Order.includes(:customer).select('orders.created_at, customers.first_name')
> this returns only order table records. What is the best way to select
> attributes of joined tables also with Active Record Query.

Have a look at the Rails Guide on ActiveRecord Associations (and the
other guides for that matter) and work right through a good tutorial
such as railstutorial.org (which is free to use online) and you will
be able to answer most of these questions yourself.

Colin

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.