Hello,
How can one get the extra attributes from the association table while
using lazy loading like so:
# I have a HMT (rails3) association and am using the includes method
to prepare my queries. But Im not able to get at the extra fields in
the association table this way.
# Schema
create_table "consultants_projects", :force => true do |t|
t.integer "consultant_id"
t.integer "project_id"
t.integer "pay_rate"
t.integer "bill_rate"
t.date "start_date"
t.date "end_date"
t.boolean "enabled", :default => true
end
add_index "consultants_projects", ["consultant_id"], :name
=>
"index_consultants_projects_on_consultant_id"
add_index "consultants_projects", ["project_id"], :name
=>
"index_consultants_projects_on_project_id"
# Model
class Project < ActiveRecord::Base
has_many :managers_projects
has_many :managers, :through => :managers_projects
# We want all the extra fields on the consultants_projects
association
has_many :consultants_projects
has_many :consultants,
:through => :consultants_projects,
:select => ''consultants.*, consultants.id,''+
''consultants_projects.id as consultants_projects_id,
''
+
''consultants_projects.project_id,'' +
''consultants_projects.pay_rate,'' +
''consultants_projects.pay_rate,'' +
''consultants_projects.bill_rate,'' +
''consultants_projects.start_date,'' +
''consultants_projects.end_date,'' +
''consultants_projects.enabled AS
consultants_projects_enabled''
end
# c = Consultant.includes(:projects)
# c.first.projects
#
# Does not include the extra fields like pay_rate, bill_rate etc that
are stored in the association table.
--
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@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Will Prater
2010-Apr-23 00:39 UTC
Re: Rails 3 associations extra attributes with lazy loading
More observations I''ve found. The Arel includes method does not seem
to respect HMT :select joins. I''d prefer to use the
"includes" lazy-
laoding way, but cannot seem to get the extra attributes to come back.
Both will return the Manager Model
===================================ruby-1.8.7-p249 > p =
Project.first.managers.first
=> #<Manager id: 1, first_name: "Edward", last_name:
"Scissorhands",
email: nil, phone: nil, created_at: "2010-04-22 22:52:29", updated_at:
"2010-04-22 22:52:29">
ruby-1.8.7-p249 > p = Project.includes(:managers).first.managers.first
=> #<Manager id: 1, first_name: "Edward", last_name:
"Scissorhands",
email: nil, phone: nil, created_at: "2010-04-22 22:52:29", updated_at:
"2010-04-22 22:52:29">
Notice that all the extra attributes are NOT passed
==================================ruby-1.8.7-p249 > p
Project.includes(:managers).first.managers.first.to_json
=>
"{\"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\":
\"2010-04-22T22:52:29Z\",\"id\":1,\"phone\":null,\"last_name\":
\"Scissorhands\",\"first_name\":\"Edward\",\"email\":null}"
Notice that all the extra attributes are passed
==================================ruby-1.8.7-p249 > p =
Project.first.managers.first.to_json
=>
"{\"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\":
\"2010-04-22T22:52:29Z\",\"project_id\":\"1\",\"primary\":\"t\",
\"manager_id\":\"1\",\"id\":1,\"phone\":null,\"last_name\":
\"Scissorhands\",\"first_name\":\"Edward\",\"email\":null}"
Here is the setup in my Model
==================================has_many :managers_projects
has_many :managers, :through => :managers_projects,
:select => ''managers.*, managers_projects.project_id,
managers_projects.manager_id, managers_projects.`primary`''
On Apr 21, 5:00 pm, Will Prater
<dataf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hello,
>
> How can one get the extra attributes from the association table while
> using lazy loading like so:
>
> # I have a HMT (rails3) association and am using the includes method
> to prepare my queries. But Im not able to get at the extra fields in
> the association table this way.
>
> # Schema
> create_table "consultants_projects", :force => true do |t|
> t.integer "consultant_id"
> t.integer "project_id"
> t.integer "pay_rate"
> t.integer "bill_rate"
> t.date "start_date"
> t.date "end_date"
> t.boolean "enabled", :default => true
> end
>
> add_index "consultants_projects", ["consultant_id"],
:name =>
> "index_consultants_projects_on_consultant_id"
> add_index "consultants_projects", ["project_id"],
:name =>
> "index_consultants_projects_on_project_id"
>
> # Model
> class Project < ActiveRecord::Base
> has_many :managers_projects
> has_many :managers, :through => :managers_projects
>
> # We want all the extra fields on the consultants_projects
> association
> has_many :consultants_projects
> has_many :consultants,
> :through => :consultants_projects,
> :select => ''consultants.*, consultants.id,''+
> ''consultants_projects.id as
consultants_projects_id, ''
> +
> ''consultants_projects.project_id,'' +
> ''consultants_projects.pay_rate,'' +
> ''consultants_projects.pay_rate,'' +
> ''consultants_projects.bill_rate,'' +
> ''consultants_projects.start_date,'' +
> ''consultants_projects.end_date,'' +
> ''consultants_projects.enabled AS
> consultants_projects_enabled''
>
> end
>
> # c = Consultant.includes(:projects)
> # c.first.projects
> #
> # Does not include the extra fields like pay_rate, bill_rate etc that
> are stored in the association table.
>
> --
> 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@public.gmane.org
> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group
athttp://groups.google.com/group/rubyonrails-talk?hl=en.
--
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@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
tommy xiao
2010-Apr-23 03:20 UTC
Re: Re: Rails 3 associations extra attributes with lazy loading
interest topic. in console, use to_sql to represent SQL, Maybe found more hits. 2010/4/23 Will Prater <datafirm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> More observations I''ve found. The Arel includes method does not seem > to respect HMT :select joins. I''d prefer to use the "includes" lazy- > laoding way, but cannot seem to get the extra attributes to come back. > > Both will return the Manager Model > ===================================> ruby-1.8.7-p249 > p = Project.first.managers.first > => #<Manager id: 1, first_name: "Edward", last_name: "Scissorhands", > email: nil, phone: nil, created_at: "2010-04-22 22:52:29", updated_at: > "2010-04-22 22:52:29"> > > ruby-1.8.7-p249 > p = Project.includes(:managers).first.managers.first > => #<Manager id: 1, first_name: "Edward", last_name: "Scissorhands", > email: nil, phone: nil, created_at: "2010-04-22 22:52:29", updated_at: > "2010-04-22 22:52:29"> > > > Notice that all the extra attributes are NOT passed > ==================================> ruby-1.8.7-p249 > p > Project.includes(:managers).first.managers.first.to_json > => "{\"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\": > \"2010-04-22T22:52:29Z\",\"id\":1,\"phone\":null,\"last_name\": > \"Scissorhands\",\"first_name\":\"Edward\",\"email\":null}" > > > Notice that all the extra attributes are passed > ==================================> ruby-1.8.7-p249 > p = Project.first.managers.first.to_json > => "{\"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\": > \"2010-04-22T22:52:29Z\",\"project_id\":\"1\",\"primary\":\"t\", > \"manager_id\":\"1\",\"id\":1,\"phone\":null,\"last_name\": > \"Scissorhands\",\"first_name\":\"Edward\",\"email\":null}" > > > Here is the setup in my Model > ==================================> has_many :managers_projects > has_many :managers, :through => :managers_projects, > :select => ''managers.*, managers_projects.project_id, > managers_projects.manager_id, managers_projects.`primary`'' > > > > On Apr 21, 5:00 pm, Will Prater <dataf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hello, > > > > How can one get the extra attributes from the association table while > > using lazy loading like so: > > > > # I have a HMT (rails3) association and am using the includes method > > to prepare my queries. But Im not able to get at the extra fields in > > the association table this way. > > > > # Schema > > create_table "consultants_projects", :force => true do |t| > > t.integer "consultant_id" > > t.integer "project_id" > > t.integer "pay_rate" > > t.integer "bill_rate" > > t.date "start_date" > > t.date "end_date" > > t.boolean "enabled", :default => true > > end > > > > add_index "consultants_projects", ["consultant_id"], :name => > > "index_consultants_projects_on_consultant_id" > > add_index "consultants_projects", ["project_id"], :name => > > "index_consultants_projects_on_project_id" > > > > # Model > > class Project < ActiveRecord::Base > > has_many :managers_projects > > has_many :managers, :through => :managers_projects > > > > # We want all the extra fields on the consultants_projects > > association > > has_many :consultants_projects > > has_many :consultants, > > :through => :consultants_projects, > > :select => ''consultants.*, consultants.id,''+ > > ''consultants_projects.id as consultants_projects_id, '' > > + > > ''consultants_projects.project_id,'' + > > ''consultants_projects.pay_rate,'' + > > ''consultants_projects.pay_rate,'' + > > ''consultants_projects.bill_rate,'' + > > ''consultants_projects.start_date,'' + > > ''consultants_projects.end_date,'' + > > ''consultants_projects.enabled AS > > consultants_projects_enabled'' > > > > end > > > > # c = Consultant.includes(:projects) > > # c.first.projects > > # > > # Does not include the extra fields like pay_rate, bill_rate etc that > > are stored in the association table. > > > > -- > > 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@public.gmane.org > > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > > For more options, visit this group athttp:// > groups.google.com/group/rubyonrails-talk?hl=en. > > -- > 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@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- tommy xiao E-mail: xiaods(AT)gmail.com -- 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@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
tommy xiao
2010-Apr-23 14:17 UTC
Re: Re: Rails 3 associations extra attributes with lazy loading
hi,Will
can you use gist to provide more code? it is examine your code.
2010/4/23 tommy xiao <xiaods-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> interest topic. in console, use to_sql to represent SQL, Maybe found more
> hits.
>
> 2010/4/23 Will Prater
<datafirm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> More observations I''ve found. The Arel includes method does not
seem
>> to respect HMT :select joins. I''d prefer to use the
"includes" lazy-
>> laoding way, but cannot seem to get the extra attributes to come back.
>>
>> Both will return the Manager Model
>> ===================================>> ruby-1.8.7-p249 > p =
Project.first.managers.first
>> => #<Manager id: 1, first_name: "Edward", last_name:
"Scissorhands",
>> email: nil, phone: nil, created_at: "2010-04-22 22:52:29",
updated_at:
>> "2010-04-22 22:52:29">
>>
>> ruby-1.8.7-p249 > p =
Project.includes(:managers).first.managers.first
>> => #<Manager id: 1, first_name: "Edward", last_name:
"Scissorhands",
>> email: nil, phone: nil, created_at: "2010-04-22 22:52:29",
updated_at:
>> "2010-04-22 22:52:29">
>>
>>
>> Notice that all the extra attributes are NOT passed
>> ==================================>> ruby-1.8.7-p249 > p
>> Project.includes(:managers).first.managers.first.to_json
>> =>
"{\"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\":
>>
\"2010-04-22T22:52:29Z\",\"id\":1,\"phone\":null,\"last_name\":
>>
\"Scissorhands\",\"first_name\":\"Edward\",\"email\":null}"
>>
>>
>> Notice that all the extra attributes are passed
>> ==================================>> ruby-1.8.7-p249 > p =
Project.first.managers.first.to_json
>> =>
"{\"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\":
>>
\"2010-04-22T22:52:29Z\",\"project_id\":\"1\",\"primary\":\"t\",
>>
\"manager_id\":\"1\",\"id\":1,\"phone\":null,\"last_name\":
>>
\"Scissorhands\",\"first_name\":\"Edward\",\"email\":null}"
>>
>>
>> Here is the setup in my Model
>> ==================================>> has_many :managers_projects
>> has_many :managers, :through => :managers_projects,
>> :select => ''managers.*, managers_projects.project_id,
>> managers_projects.manager_id, managers_projects.`primary`''
>>
>>
>>
>> On Apr 21, 5:00 pm, Will Prater
<dataf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> > Hello,
>> >
>> > How can one get the extra attributes from the association table
while
>> > using lazy loading like so:
>> >
>> > # I have a HMT (rails3) association and am using the includes
method
>> > to prepare my queries. But Im not able to get at the extra fields
in
>> > the association table this way.
>> >
>> > # Schema
>> > create_table "consultants_projects", :force => true
do |t|
>> > t.integer "consultant_id"
>> > t.integer "project_id"
>> > t.integer "pay_rate"
>> > t.integer "bill_rate"
>> > t.date "start_date"
>> > t.date "end_date"
>> > t.boolean "enabled", :default => true
>> > end
>> >
>> > add_index "consultants_projects",
["consultant_id"], :name =>
>> > "index_consultants_projects_on_consultant_id"
>> > add_index "consultants_projects",
["project_id"], :name =>
>> > "index_consultants_projects_on_project_id"
>> >
>> > # Model
>> > class Project < ActiveRecord::Base
>> > has_many :managers_projects
>> > has_many :managers, :through => :managers_projects
>> >
>> > # We want all the extra fields on the consultants_projects
>> > association
>> > has_many :consultants_projects
>> > has_many :consultants,
>> > :through => :consultants_projects,
>> > :select => ''consultants.*,
consultants.id,''+
>> > ''consultants_projects.id as
consultants_projects_id, ''
>> > +
>> >
''consultants_projects.project_id,'' +
>> > ''consultants_projects.pay_rate,''
+
>> > ''consultants_projects.pay_rate,''
+
>> >
''consultants_projects.bill_rate,'' +
>> >
''consultants_projects.start_date,'' +
>> > ''consultants_projects.end_date,''
+
>> > ''consultants_projects.enabled AS
>> > consultants_projects_enabled''
>> >
>> > end
>> >
>> > # c = Consultant.includes(:projects)
>> > # c.first.projects
>> > #
>> > # Does not include the extra fields like pay_rate, bill_rate etc
that
>> > are stored in the association table.
>> >
>> > --
>> > 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@public.gmane.org
>> > To unsubscribe from this group, send email to
>>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
>> .
>> > For more options, visit this group athttp://
>> groups.google.com/group/rubyonrails-talk?hl=en.
>>
>> --
>> 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@public.gmane.org
>> To unsubscribe from this group, send email to
>>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>>
>
>
> --
> tommy xiao
> E-mail: xiaods(AT)gmail.com
>
--
tommy xiao
E-mail: xiaods(AT)gmail.com
--
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@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Will Prater
2010-Apr-23 18:14 UTC
Re: Rails 3 associations extra attributes with lazy loading
Hi,
Sure, here is the schema, and model files. Let me know what you
think. Why can''t I get the :select to work when using
".includes".
In the console examples below, you can see the pay_rate and bill_rate
are not present in the example using .includes.
Schema
https://gist.github.com/76e70c7f31b6dcc5cfcc
Consultant Model
https://gist.github.com/93e5858417bb14ec18c9
Project Model
https://gist.github.com/8545e9da49742b4e4dcb
Console output using .includes does not honor :select
=======================================ruby-1.8.7-p249 >
Project.includes(:consultants).first.to_json(:include => :consultants)
=> "{\"start_date\":null,\"name\":\"Widget
Assembly\",\"created_at\":
\"2010-04-22T22:52:29Z\",\"updated_at\":\"2010-04-22T22:52:29Z\",
\"sales_contact_id\":null,\"id\":1,\"enabled\":true,\"client_id\":
1,\"consultants\":[{\"created_at\":\"2010-04-22T22:52:29Z\",
\"updated_at\":\"2010-04-23T02:35:58Z\",\"recruiter_contact_id\":
1,\"payclass\":2,\"id\":1,\"enabled\":true,\"phone\":\"\",\"last_name
\":\"Wright\",\"first_name\":\"Steve\",\"email\":\"steve-5fdHrIrKMJ5Wk0Htik3J/w@public.gmane.org
\"}],\"end_date\":null}"
Console output using does honor :select, but uses N + 1 queries for
all the consultants in a project
=======================================ruby-1.8.7-p249 >
Project.first.to_json(:include => :consultants)
=> "{\"start_date\":null,\"name\":\"Widget
Assembly\",\"created_at\":
\"2010-04-22T22:52:29Z\",\"updated_at\":\"2010-04-22T22:52:29Z\",
\"sales_contact_id\":null,\"id\":1,\"enabled\":true,\"client_id\":
1,\"consultants\":[{\"start_date\":null,\"pay_rate\":\"40\",
\"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\":
\"2010-04-23T02:35:58Z\",\"recruiter_contact_id\":1,\"project_id\":
\"1\",\"consultants_projects_id\":\"1\",\"bill_rate\":\"80\",\"payclass
\":2,\"id\":1,\"enabled\":true,\"consultants_projects_enabled\":\"t\",
\"phone\":\"\",\"last_name\":\"Wright\",\"end_date\":null,\"first_name
\":\"Steve\",\"email\":\"steve-5fdHrIrKMJ5Wk0Htik3J/w@public.gmane.org\"}],\"end_date\":null}"
Any help is appreciated. Am I doing something wrong, or is this just
not supported?
-Will
On Apr 23, 7:17 am, tommy xiao
<xia...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> hi,Will
> can you use gist to provide more code? it is examine your code.
>
> 2010/4/23 tommy xiao <xia...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
>
>
>
>
> > interest topic. in console, use to_sql to represent SQL, Maybe found
more
> > hits.
>
> > 2010/4/23 Will Prater
<dataf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> > More observations I''ve found. The Arel includes method does
not seem
> >> to respect HMT :select joins. I''d prefer to use the
"includes" lazy-
> >> laoding way, but cannot seem to get the extra attributes to come
back.
>
> >> Both will return the Manager Model
> >> ===================================> >> ruby-1.8.7-p249
> p = Project.first.managers.first
> >> => #<Manager id: 1, first_name: "Edward",
last_name: "Scissorhands",
> >> email: nil, phone: nil, created_at: "2010-04-22
22:52:29", updated_at:
> >> "2010-04-22 22:52:29">
>
> >> ruby-1.8.7-p249 > p =
Project.includes(:managers).first.managers.first
> >> => #<Manager id: 1, first_name: "Edward",
last_name: "Scissorhands",
> >> email: nil, phone: nil, created_at: "2010-04-22
22:52:29", updated_at:
> >> "2010-04-22 22:52:29">
>
> >> Notice that all the extra attributes are NOT passed
> >> ==================================> >> ruby-1.8.7-p249
> p > >> Project.includes(:managers).first.managers.first.to_json
> >> =>
"{\"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\":
> >>
\"2010-04-22T22:52:29Z\",\"id\":1,\"phone\":null,\"last_name\":
> >>
\"Scissorhands\",\"first_name\":\"Edward\",\"email\":null}"
>
> >> Notice that all the extra attributes are passed
> >> ==================================> >> ruby-1.8.7-p249
> p = Project.first.managers.first.to_json
> >> =>
"{\"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\":
> >>
\"2010-04-22T22:52:29Z\",\"project_id\":\"1\",\"primary\":\"t\",
> >>
\"manager_id\":\"1\",\"id\":1,\"phone\":null,\"last_name\":
> >>
\"Scissorhands\",\"first_name\":\"Edward\",\"email\":null}"
>
> >> Here is the setup in my Model
> >> ==================================> >> has_many
:managers_projects
> >> has_many :managers, :through => :managers_projects,
> >> :select => ''managers.*, managers_projects.project_id,
> >> managers_projects.manager_id,
managers_projects.`primary`''
>
> >> On Apr 21, 5:00 pm, Will Prater
<dataf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >> > Hello,
>
> >> > How can one get the extra attributes from the association
table while
> >> > using lazy loading like so:
>
> >> > # I have a HMT (rails3) association and am using the includes
method
> >> > to prepare my queries. But Im not able to get at the extra
fields in
> >> > the association table this way.
>
> >> > # Schema
> >> > create_table "consultants_projects", :force =>
true do |t|
> >> > t.integer "consultant_id"
> >> > t.integer "project_id"
> >> > t.integer "pay_rate"
> >> > t.integer "bill_rate"
> >> > t.date "start_date"
> >> > t.date "end_date"
> >> > t.boolean "enabled", :default => true
> >> > end
>
> >> > add_index "consultants_projects",
["consultant_id"], :name =>
> >> > "index_consultants_projects_on_consultant_id"
> >> > add_index "consultants_projects",
["project_id"], :name =>
> >> > "index_consultants_projects_on_project_id"
>
> >> > # Model
> >> > class Project < ActiveRecord::Base
> >> > has_many :managers_projects
> >> > has_many :managers, :through => :managers_projects
>
> >> > # We want all the extra fields on the consultants_projects
> >> > association
> >> > has_many :consultants_projects
> >> > has_many :consultants,
> >> > :through => :consultants_projects,
> >> > :select => ''consultants.*,
consultants.id,''+
> >> > ''consultants_projects.id as
consultants_projects_id, ''
> >> > +
> >> >
''consultants_projects.project_id,'' +
> >> >
''consultants_projects.pay_rate,'' +
> >> >
''consultants_projects.pay_rate,'' +
> >> >
''consultants_projects.bill_rate,'' +
> >> >
''consultants_projects.start_date,'' +
> >> >
''consultants_projects.end_date,'' +
> >> > ''consultants_projects.enabled AS
> >> > consultants_projects_enabled''
>
> >> > end
>
> >> > # c = Consultant.includes(:projects)
> >> > # c.first.projects
> >> > #
> >> > # Does not include the extra fields like pay_rate, bill_rate
etc that
> >> > are stored in the association table.
>
> >> > --
> >> > 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@public.gmane.org
> >> > To unsubscribe from this group, send email to
> >>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib
e@googlegroups.com>
> >> .
> >> > For more options, visit this group athttp://
> >> groups.google.com/group/rubyonrails-talk?hl=en.
>
> >> --
> >> 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@public.gmane.org
> >> To unsubscribe from this group, send email to
> >>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib
e@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/rubyonrails-talk?hl=en.
>
> > --
> > tommy xiao
> > E-mail: xiaods(AT)gmail.com
>
> --
> tommy xiao
> E-mail: xiaods(AT)gmail.com
>
> --
> 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@public.gmane.org
> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group
athttp://groups.google.com/group/rubyonrails-talk?hl=en.
--
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@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Will Prater
2010-Apr-23 23:39 UTC
Re: Rails 3 associations extra attributes with lazy loading
I''ve fixed my issues. Should have been using joins vs includes as there was really no joins happening with eager loading. On Apr 23, 11:14 am, Will Prater <dataf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Sure, here is the schema, and model files. Let me know what you > think. Why can''t I get the :select to work when using ".includes". > In the console examples below, you can see the pay_rate and bill_rate > are not present in the example using .includes. > > Schemahttps://gist.github.com/76e70c7f31b6dcc5cfcc > > Consultant Modelhttps://gist.github.com/93e5858417bb14ec18c9 > > Project Modelhttps://gist.github.com/8545e9da49742b4e4dcb > > Console output using .includes does not honor :select > =======================================> ruby-1.8.7-p249 > > Project.includes(:consultants).first.to_json(:include => :consultants) > => "{\"start_date\":null,\"name\":\"Widget Assembly\",\"created_at\": > \"2010-04-22T22:52:29Z\",\"updated_at\":\"2010-04-22T22:52:29Z\", > \"sales_contact_id\":null,\"id\":1,\"enabled\":true,\"client_id\": > 1,\"consultants\":[{\"created_at\":\"2010-04-22T22:52:29Z\", > \"updated_at\":\"2010-04-23T02:35:58Z\",\"recruiter_contact_id\": > 1,\"payclass\":2,\"id\":1,\"enabled\":true,\"phone\":\"\",\"last_name > \":\"Wright\",\"first_name\":\"Steve\",\"email\":\"st...-5fdHrIrKMJ5Wk0Htik3J/w@public.gmane.org > \"}],\"end_date\":null}" > > Console output using does honor :select, but uses N + 1 queries for > all the consultants in a project > =======================================> ruby-1.8.7-p249 > Project.first.to_json(:include => :consultants) > => "{\"start_date\":null,\"name\":\"Widget Assembly\",\"created_at\": > \"2010-04-22T22:52:29Z\",\"updated_at\":\"2010-04-22T22:52:29Z\", > \"sales_contact_id\":null,\"id\":1,\"enabled\":true,\"client_id\": > 1,\"consultants\":[{\"start_date\":null,\"pay_rate\":\"40\", > \"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\": > \"2010-04-23T02:35:58Z\",\"recruiter_contact_id\":1,\"project_id\": > \"1\",\"consultants_projects_id\":\"1\",\"bill_rate\":\"80\",\"payclass > \":2,\"id\":1,\"enabled\":true,\"consultants_projects_enabled\":\"t\", > \"phone\":\"\",\"last_name\":\"Wright\",\"end_date\":null,\"first_name > \":\"Steve\",\"email\":\"st...-5fdHrIrKMJ5Wk0Htik3J/w@public.gmane.org\"}],\"end_date\":null}" > > Any help is appreciated. Am I doing something wrong, or is this just > not supported? > > -Will > > On Apr 23, 7:17 am, tommy xiao <xia...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > hi,Will > > can you use gist to provide more code? it is examine your code. > > > 2010/4/23 tommy xiao <xia...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > interest topic. in console, use to_sql to represent SQL, Maybe found more > > > hits. > > > > 2010/4/23 Will Prater <dataf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > More observations I''ve found. The Arel includes method does not seem > > >> to respect HMT :select joins. I''d prefer to use the "includes" lazy- > > >> laoding way, but cannot seem to get the extra attributes to come back. > > > >> Both will return the Manager Model > > >> ===================================> > >> ruby-1.8.7-p249 > p = Project.first.managers.first > > >> => #<Manager id: 1, first_name: "Edward", last_name: "Scissorhands", > > >> email: nil, phone: nil, created_at: "2010-04-22 22:52:29", updated_at: > > >> "2010-04-22 22:52:29"> > > > >> ruby-1.8.7-p249 > p = Project.includes(:managers).first.managers.first > > >> => #<Manager id: 1, first_name: "Edward", last_name: "Scissorhands", > > >> email: nil, phone: nil, created_at: "2010-04-22 22:52:29", updated_at: > > >> "2010-04-22 22:52:29"> > > > >> Notice that all the extra attributes are NOT passed > > >> ==================================> > >> ruby-1.8.7-p249 > p > > >> Project.includes(:managers).first.managers.first.to_json > > >> => "{\"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\": > > >> \"2010-04-22T22:52:29Z\",\"id\":1,\"phone\":null,\"last_name\": > > >> \"Scissorhands\",\"first_name\":\"Edward\",\"email\":null}" > > > >> Notice that all the extra attributes are passed > > >> ==================================> > >> ruby-1.8.7-p249 > p = Project.first.managers.first.to_json > > >> => "{\"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\": > > >> \"2010-04-22T22:52:29Z\",\"project_id\":\"1\",\"primary\":\"t\", > > >> \"manager_id\":\"1\",\"id\":1,\"phone\":null,\"last_name\": > > >> \"Scissorhands\",\"first_name\":\"Edward\",\"email\":null}" > > > >> Here is the setup in my Model > > >> ==================================> > >> has_many :managers_projects > > >> has_many :managers, :through => :managers_projects, > > >> :select => ''managers.*, managers_projects.project_id, > > >> managers_projects.manager_id, managers_projects.`primary`'' > > > >> On Apr 21, 5:00 pm, Will Prater <dataf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> > Hello, > > > >> > How can one get the extra attributes from the association table while > > >> > using lazy loading like so: > > > >> > # I have a HMT (rails3) association and am using the includes method > > >> > to prepare my queries. But Im not able to get at the extra fields in > > >> > the association table this way. > > > >> > # Schema > > >> > create_table "consultants_projects", :force => true do |t| > > >> > t.integer "consultant_id" > > >> > t.integer "project_id" > > >> > t.integer "pay_rate" > > >> > t.integer "bill_rate" > > >> > t.date "start_date" > > >> > t.date "end_date" > > >> > t.boolean "enabled", :default => true > > >> > end > > > >> > add_index "consultants_projects", ["consultant_id"], :name => > > >> > "index_consultants_projects_on_consultant_id" > > >> > add_index "consultants_projects", ["project_id"], :name => > > >> > "index_consultants_projects_on_project_id" > > > >> > # Model > > >> > class Project < ActiveRecord::Base > > >> > has_many :managers_projects > > >> > has_many :managers, :through => :managers_projects > > > >> > # We want all the extra fields on the consultants_projects > > >> > association > > >> > has_many :consultants_projects > > >> > has_many :consultants, > > >> > :through => :consultants_projects, > > >> > :select => ''consultants.*, consultants.id,''+ > > >> > ''consultants_projects.id as consultants_projects_id, '' > > >> > + > > >> > ''consultants_projects.project_id,'' + > > >> > ''consultants_projects.pay_rate,'' + > > >> > ''consultants_projects.pay_rate,'' + > > >> > ''consultants_projects.bill_rate,'' + > > >> > ''consultants_projects.start_date,'' + > > >> > ''consultants_projects.end_date,'' + > > >> > ''consultants_projects.enabled AS > > >> > consultants_projects_enabled'' > > > >> > end > > > >> > # c = Consultant.includes(:projects) > > >> > # c.first.projects > > >> > # > > >> > # Does not include the extra fields like pay_rate, bill_rate etc that > > >> > are stored in the association table. > > > >> > -- > > >> > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com> > > >> . > > >> > For more options, visit this group athttp:// > > >> groups.google.com/group/rubyonrails-talk?hl=en. > > > >> -- > > >> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com> > > >> . > > >> For more options, visit this group at > > >>http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > > > tommy xiao > > > E-mail: xiaods(AT)gmail.com > > > -- > > tommy xiao > > E-mail: xiaods(AT)gmail.com > > > -- > > 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@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > 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@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
tommy xiao
2010-Apr-24 12:23 UTC
Re: Re: Rails 3 associations extra attributes with lazy loading
This''s what my think. use sql log you can see more details. 2010/4/24 Will Prater <datafirm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> I''ve fixed my issues. Should have been using joins vs includes as > there was really no joins happening with eager loading. > > On Apr 23, 11:14 am, Will Prater <dataf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi, > > > > Sure, here is the schema, and model files. Let me know what you > > think. Why can''t I get the :select to work when using ".includes". > > In the console examples below, you can see the pay_rate and bill_rate > > are not present in the example using .includes. > > > > Schemahttps://gist.github.com/76e70c7f31b6dcc5cfcc > > > > Consultant Modelhttps://gist.github.com/93e5858417bb14ec18c9 > > > > Project Modelhttps://gist.github.com/8545e9da49742b4e4dcb > > > > Console output using .includes does not honor :select > > =======================================> > ruby-1.8.7-p249 > > > Project.includes(:consultants).first.to_json(:include => :consultants) > > => "{\"start_date\":null,\"name\":\"Widget Assembly\",\"created_at\": > > \"2010-04-22T22:52:29Z\",\"updated_at\":\"2010-04-22T22:52:29Z\", > > \"sales_contact_id\":null,\"id\":1,\"enabled\":true,\"client_id\": > > 1,\"consultants\":[{\"created_at\":\"2010-04-22T22:52:29Z\", > > \"updated_at\":\"2010-04-23T02:35:58Z\",\"recruiter_contact_id\": > > 1,\"payclass\":2,\"id\":1,\"enabled\":true,\"phone\":\"\",\"last_name > > \":\"Wright\",\"first_name\":\"Steve\",\"email\":\"st...-5fdHrIrKMJ5Wk0Htik3J/w@public.gmane.org > > \"}],\"end_date\":null}" > > > > Console output using does honor :select, but uses N + 1 queries for > > all the consultants in a project > > =======================================> > ruby-1.8.7-p249 > Project.first.to_json(:include => :consultants) > > => "{\"start_date\":null,\"name\":\"Widget Assembly\",\"created_at\": > > \"2010-04-22T22:52:29Z\",\"updated_at\":\"2010-04-22T22:52:29Z\", > > \"sales_contact_id\":null,\"id\":1,\"enabled\":true,\"client_id\": > > 1,\"consultants\":[{\"start_date\":null,\"pay_rate\":\"40\", > > \"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\": > > \"2010-04-23T02:35:58Z\",\"recruiter_contact_id\":1,\"project_id\": > > \"1\",\"consultants_projects_id\":\"1\",\"bill_rate\":\"80\",\"payclass > > \":2,\"id\":1,\"enabled\":true,\"consultants_projects_enabled\":\"t\", > > \"phone\":\"\",\"last_name\":\"Wright\",\"end_date\":null,\"first_name > > \":\"Steve\",\"email\":\"st...-5fdHrIrKMJ5Wk0Htik3J/w@public.gmane.org\"}],\"end_date\":null}" > > > > Any help is appreciated. Am I doing something wrong, or is this just > > not supported? > > > > -Will > > > > On Apr 23, 7:17 am, tommy xiao <xia...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > > hi,Will > > > can you use gist to provide more code? it is examine your code. > > > > > 2010/4/23 tommy xiao <xia...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > > interest topic. in console, use to_sql to represent SQL, Maybe found > more > > > > hits. > > > > > > 2010/4/23 Will Prater <dataf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > > More observations I''ve found. The Arel includes method does not seem > > > >> to respect HMT :select joins. I''d prefer to use the "includes" > lazy- > > > >> laoding way, but cannot seem to get the extra attributes to come > back. > > > > > >> Both will return the Manager Model > > > >> ===================================> > > >> ruby-1.8.7-p249 > p = Project.first.managers.first > > > >> => #<Manager id: 1, first_name: "Edward", last_name: > "Scissorhands", > > > >> email: nil, phone: nil, created_at: "2010-04-22 22:52:29", > updated_at: > > > >> "2010-04-22 22:52:29"> > > > > > >> ruby-1.8.7-p249 > p > Project.includes(:managers).first.managers.first > > > >> => #<Manager id: 1, first_name: "Edward", last_name: > "Scissorhands", > > > >> email: nil, phone: nil, created_at: "2010-04-22 22:52:29", > updated_at: > > > >> "2010-04-22 22:52:29"> > > > > > >> Notice that all the extra attributes are NOT passed > > > >> ==================================> > > >> ruby-1.8.7-p249 > p > > > >> Project.includes(:managers).first.managers.first.to_json > > > >> => "{\"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\": > > > >> \"2010-04-22T22:52:29Z\",\"id\":1,\"phone\":null,\"last_name\": > > > >> \"Scissorhands\",\"first_name\":\"Edward\",\"email\":null}" > > > > > >> Notice that all the extra attributes are passed > > > >> ==================================> > > >> ruby-1.8.7-p249 > p = Project.first.managers.first.to_json > > > >> => "{\"created_at\":\"2010-04-22T22:52:29Z\",\"updated_at\": > > > >> \"2010-04-22T22:52:29Z\",\"project_id\":\"1\",\"primary\":\"t\", > > > >> \"manager_id\":\"1\",\"id\":1,\"phone\":null,\"last_name\": > > > >> \"Scissorhands\",\"first_name\":\"Edward\",\"email\":null}" > > > > > >> Here is the setup in my Model > > > >> ==================================> > > >> has_many :managers_projects > > > >> has_many :managers, :through => :managers_projects, > > > >> :select => ''managers.*, managers_projects.project_id, > > > >> managers_projects.manager_id, managers_projects.`primary`'' > > > > > >> On Apr 21, 5:00 pm, Will Prater <dataf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > >> > Hello, > > > > > >> > How can one get the extra attributes from the association table > while > > > >> > using lazy loading like so: > > > > > >> > # I have a HMT (rails3) association and am using the includes > method > > > >> > to prepare my queries. But Im not able to get at the extra fields > in > > > >> > the association table this way. > > > > > >> > # Schema > > > >> > create_table "consultants_projects", :force => true do |t| > > > >> > t.integer "consultant_id" > > > >> > t.integer "project_id" > > > >> > t.integer "pay_rate" > > > >> > t.integer "bill_rate" > > > >> > t.date "start_date" > > > >> > t.date "end_date" > > > >> > t.boolean "enabled", :default => true > > > >> > end > > > > > >> > add_index "consultants_projects", ["consultant_id"], :name => > > > >> > "index_consultants_projects_on_consultant_id" > > > >> > add_index "consultants_projects", ["project_id"], :name => > > > >> > "index_consultants_projects_on_project_id" > > > > > >> > # Model > > > >> > class Project < ActiveRecord::Base > > > >> > has_many :managers_projects > > > >> > has_many :managers, :through => :managers_projects > > > > > >> > # We want all the extra fields on the consultants_projects > > > >> > association > > > >> > has_many :consultants_projects > > > >> > has_many :consultants, > > > >> > :through => :consultants_projects, > > > >> > :select => ''consultants.*, consultants.id,''+ > > > >> > ''consultants_projects.id as > consultants_projects_id, '' > > > >> > + > > > >> > ''consultants_projects.project_id,'' + > > > >> > ''consultants_projects.pay_rate,'' + > > > >> > ''consultants_projects.pay_rate,'' + > > > >> > ''consultants_projects.bill_rate,'' + > > > >> > ''consultants_projects.start_date,'' + > > > >> > ''consultants_projects.end_date,'' + > > > >> > ''consultants_projects.enabled AS > > > >> > consultants_projects_enabled'' > > > > > >> > end > > > > > >> > # c = Consultant.includes(:projects) > > > >> > # c.first.projects > > > >> > # > > > >> > # Does not include the extra fields like pay_rate, bill_rate etc > that > > > >> > are stored in the association table. > > > > > >> > -- > > > >> > 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@public.gmane.org > > > >> > To unsubscribe from this group, send email to > > > >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org><rubyonrails-talk%2Bunsubscrib > e@googlegroups.com> > > > >> . > > > >> > For more options, visit this group athttp:// > > > >> groups.google.com/group/rubyonrails-talk?hl=en. > > > > > >> -- > > > >> 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@public.gmane.org > > > >> To unsubscribe from this group, send email to > > > >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org><rubyonrails-talk%2Bunsubscrib > e@googlegroups.com> > > > >> . > > > >> For more options, visit this group at > > > >>http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > > > -- > > > > tommy xiao > > > > E-mail: xiaods(AT)gmail.com > > > > > -- > > > tommy xiao > > > E-mail: xiaods(AT)gmail.com > > > > > -- > > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > > > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > > > For more options, visit this group athttp:// > groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > > 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@public.gmane.org > > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > > For more options, visit this group athttp:// > groups.google.com/group/rubyonrails-talk?hl=en. > > -- > 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@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- tommy xiao E-mail: xiaods(AT)gmail.com -- 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@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.