Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
:include => :model => :only... excludes columns if one of returned rows doesn't include the :model.column
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
gluis  
View profile  
 More options May 20, 1:39 pm
From: gluis <louisju...@gmail.com>
Date: Wed, 20 May 2009 10:39:14 -0700 (PDT)
Local: Wed, May 20 2009 1:39 pm
Subject: :include => :model => :only... excludes columns if one of returned rows doesn't include the :model.column
hi,
as the long-subject line suggests:

i'm confused about some behavior w/ the following from
acts_as_reportable:

assume 2 models:
Member :has_many :events, :through => some_other_model
Event, :has_many :members, :through => some_other_model

assume 2 records in members table
assume 1st from members has an event, the other doesn't

this
Member.report_table(:first, :only => [:login], :include => {:events =>
{:only => [:title]}})
returns both login and event.title columns

BUT
this
Member.report_table(:all, :only => [:login], :include => {:events =>
{:only => [:title]}})
returns only the login for Member (b/c the other record in members
doesn't have an event associated)

i can fix it by using a transform, but i'm writing a reporting system
for ppl to compose their own reports (so, they're generated on the
fly), and although i could make it work using transform, it sounds
like a lot of spaghetti code for something i assume ruport handles
already (and i just haven't figured it out).

any suggestions?

thanks a million,

louis


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew France  
View profile  
 More options May 20, 6:45 pm
From: Andrew France <andrew+li...@avito.co.uk>
Date: Wed, 20 May 2009 23:45:16 +0100
Local: Wed, May 20 2009 6:45 pm
Subject: Re: [ruport] :include => :model => :only... excludes columns if one of returned rows doesn't include the :model.column

Could you please try the latest from GitHub at:
http://github.com/ruport/acts_as_reportable/tree/master

Should work as a gem with GitHub as a source (ruport-acts_as_reportable
I guess), vendor'd in Rails, or just requiring the single lib file directly!

Please let me know if this fixes your issue and doesn't break any other
reports you may have. If so, I will aim to get this released into the
proper gem repository next week as the fix has been lingering around for
quite a while now.

All the best,
Andrew


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gluis  
View profile  
 More options May 20, 10:57 pm
From: gluis <louisju...@gmail.com>
Date: Wed, 20 May 2009 19:57:36 -0700 (PDT)
Local: Wed, May 20 2009 10:57 pm
Subject: Re: :include => :model => :only... excludes columns if one of returned rows doesn't include the :model.column
thanks, andrew, i'll chk test this out tomorrow(may 21) and report
back!

On May 20, 6:45 pm, Andrew France <andrew+li...@avito.co.uk> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gluis  
View profile  
 More options May 20, 11:10 pm
From: gluis <louisju...@gmail.com>
Date: Wed, 20 May 2009 20:10:47 -0700 (PDT)
Local: Wed, May 20 2009 11:10 pm
Subject: Re: :include => :model => :only... excludes columns if one of returned rows doesn't include the :model.column
well, being an impatient sort, i didn't wait till tomorrow. success.

it worked like a charm! nicely done.

thanks! you've saved me from writing a lot of lines of ugly code!
:-)

On May 20, 6:45 pm, Andrew France <andrew+li...@avito.co.uk> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google