I am on Rails 2.0.2 (not 2.1.x due to a couple of tickets) and if this
topic is invalid if only I upgraded, please excuse me for not being able
to have a perfect overview
My use case is: users are invited to events - and each event is
scheduled to āperformā a number of times. This gives me the tables:
users, scheduled_events, event_users.
I have set up associations on the models like this:
events has_many scheduled_events
scheduled_events belongs_to event
event_users belongs_to event and belongs_to user
Then Iāve tried to set up an association providing me with the scheduled
events to an invited user like this
event_users has_many scheduled_events through event
But after googling about for the better part of a day and reading Josh
Susser extensively, I am lead to believe that has_many through only
works on has_many associations - ie. Iām not at liberty to go through a
belongs_to association.
Does anyone here have a take on how to solve this? Or am I perhaps just
messing this association thing up?
On Tue, Oct 14, 2008 at 4:27 PM, Walther D. [email protected] wrote:
But after googling about for the better part of a day and reading Josh
Susser extensively, I am lead to believe that has_many through only
works on has_many associations - ie. Iām not at liberty to go through a
belongs_to association.
Does anyone here have a take on how to solve this? Or am I perhaps just
messing this association thing up?
This should work fine in Edge. Did you try to upgrade to edge ?
On Tue, Oct 14, 2008 at 4:27 PM, Walther D. [email protected] wrote:
But after googling about for the better part of a day and reading Josh
Susser extensively, I am lead to believe that has_many through only
works on has_many associations - ie. Iām not at liberty to go through a
belongs_to association.
Does anyone here have a take on how to solve this? Or am I perhaps just
messing this association thing up?
This should work fine in Edge. Did you try to upgrade to edge ?
Iām overwhelmed - did not even dare to hope for any replies - and
certainly not this fast!
I am adding to a production site on 2.0.2 - and I have not been able to
find any good docs on how to upgrade to edge on my mac and still have my
2.0.2 development environment intact (it is very important to me that
my existing 2.0.2 does work and will let me deploy to 2.0.2 production
sites)
Is that possible? Upgrading on my development mac - and still deploy to
2.0.2 production? And perhaps even - downgrading again - should the
upgrade turn out to hold to many TODOS?
thank you Pratik - Iāve come around your name on a great many posts,
tickets etc and Iām amased at the amount of work you put into this
community!
On Tue, Oct 14, 2008 at 4:27 PM, Walther D. [email protected] wrote:
But after googling about for the better part of a day and reading Josh
Susser extensively, I am lead to believe that has_many through only
works on has_many associations - ie. Iām not at liberty to go through a
belongs_to association.
Does anyone here have a take on how to solve this? Or am I perhaps just
messing this association thing up?
This should work fine in Edge. Did you try to upgrade to edge ?
Iām overwhelmed - did not even dare to hope for any replies - and
certainly not this fast!
I am adding to a production site on 2.0.2 - and I have not been able to
find any good docs on how to upgrade to edge on my mac and still have my
2.0.2 development environment intact (it is very important to me that
my existing 2.0.2 does work and will let me deploy to 2.0.2 production
sites)
Is that possible? Upgrading on my development mac - and still deploy to
2.0.2 production? And perhaps even - downgrading again - should the
upgrade turn out to hold to many TODOS?
thank you Pratik - Iāve come around your name on a great many posts,
tickets etc and Iām amased at the amount of work you put into this
community!
thank you again,
walt
Pratik,
Iāll try the āfreeze railsā-thing and see if that will do the trick
On Tue, Oct 14, 2008 at 4:27 PM, Walther D. [email protected] wrote:
But after googling about for the better part of a day and reading Josh
Susser extensively, I am lead to believe that has_many through only
works on has_many associations - ie. Iām not at liberty to go through a
belongs_to association.
Does anyone here have a take on how to solve this? Or am I perhaps just
messing this association thing up?
This should work fine in Edge. Did you try to upgrade to edge ?
Iām overwhelmed - did not even dare to hope for any replies - and
certainly not this fast!
I am adding to a production site on 2.0.2 - and I have not been able to
find any good docs on how to upgrade to edge on my mac and still have my
2.0.2 development environment intact (it is very important to me that
my existing 2.0.2 does work and will let me deploy to 2.0.2 production
sites)
Is that possible? Upgrading on my development mac - and still deploy to
2.0.2 production? And perhaps even - downgrading again - should the
upgrade turn out to hold to many TODOS?
thank you Pratik - Iāve come around your name on a great many posts,
tickets etc and Iām amased at the amount of work you put into this
community!
thank you again,
walt
Pratik,
Iāll try the āfreeze railsā-thing and see if that will do the trick
thank you again,
walt
'shoot - Iāll better stay of the freezing path - what started out as a
small Just-Let-Me-Fix-That-Association-For-You turned into a
I-Cannot-Start-My-Project-Due-To-Missing-Methods-On-Core
So, I froze - and the project likewize <:)
First missing method is render_file - and Iām afraid that once I get
that āson of gun nailedā, edge has a queue of missing things built up
for me!
Too bad though - I really could have used that hmt belongs_to ā¦
I cloned the rails.git off of github into its own folder, then symlinked
it into vendor/rails on my project.
Then I did script/server --debugger as usual - and it chokes with:
ā¦/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb:33:in alias_method': undefined method render_fileā for class
`ActionView::Baseā (NameError)
Just had the same unpleasant experience with bleeding edge, looks like
too much troubleā¦ wanted the upcoming internationalization backed
into Rails directly, though. Sighā¦
On Oct 15, 3:05 am, Walther D. <rails-mailing-lā¦@andreas-
ā¦/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb:33:in alias_method': undefined methodrender_fileā for class
`ActionView::Baseā (NameError)
Chalked this one up on me not keeping tabs on inherit_views plugin which
orignally manhandled the render_file method - upgrading that plugin had
me move onā¦
to the next problem: mislav_will_paginate (which he will not in edge
due to:
and off to the races, I was - in my script/console - eager to see the
promised land of has_many through a belongs_to.
Only to see this:
undefined method quoted_table_name' for false:FalseClass from .../vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb:123:inconstruct_conditionsā
Before all this turns sour - Iām going to dump this branch - and hurry
back in the comforting shadows of 2.0.2 with my original plugins intact.
and then on my events_controller - I stabbed this into the find_resource
enclosing_resource.invitations.collect { |i|
i.scheduled_events.month_year(fd,ld) }.flatten
case closed (for me - but I still shiver from the tour de force into the
freeze)!
Just spent couple of hours debugging itā¦ Well, Rails-Edge alone
seems to work fine, so I figured out it should be some plugin,
deactivating them one at a time I found out, that it is
has_many_polymorphs,
that doesnāt like Edge and has_many-through-Associations.
Well, maybe itās time to say goodbye? Guess, Evan from
doesnāt have much time right now, working on Twitter.
doesnāt have much time right now, working on Twitter.
due to:
Before all this turns sour - Iām going to dump this branch - and hurry
and then on my events_controller - I stabbed this into the find_resource
enclosing_resource.invitations.collect { |i|
i.scheduled_events.month_year(fd,ld) }.flatten
case closed (for me - but I still shiver from the tour de force into the
freeze)!
Iām porting a 1.2.6 app to 2.2.0 and found that using Martin
Gamsjaegerās fork fixed most HMP issues though I still get the method
error for āmacroā as you do. Canāt quite figure it out. Anyone else
get it? Iām not seeing any forks on Github dealing with the error.
Iām porting a 1.2.6 app to 2.2.0 and found that using Martin
Gamsjaegerās fork fixed most HMP issues though I still get the method
error for āmacroā as you do. Canāt quite figure it out. Anyone else
get it? Iām not seeing any forks on Github dealing with the error.
Sorry I didnāt get back to that thread for so long! I must have
overlooked it ā¦ maybe because my fix is still working for me (using
rails-2.2.2, but using mostly my own additional methods). That said,
Iām not really sure how to reproduce the error you guys get. Maybe
itās a good idea to put a sample app that triggers the error up on
github? I could have a look tommorrow evening, although I must say
that I really donāt know too much about the plugins code! I just
noticed a method in hmp that is an almost exact duplicate of a rails
method, and updated hmpās one to reflect the latest rails code (that
basically was the last fix).
Sorry I didnāt get back to that thread for so long! I must have
overlooked it ā¦ maybe because my fix is still working for me (using
rails-2.2.2, but using mostly my own additional methods). That said,
Iām not really sure how to reproduce the error you guys get. Maybe
itās a good idea to put a sample app that triggers the error up on
github? I could have a look tommorrow evening, although I must say
that I really donāt know too much about the plugins code! I just
noticed a method in hmp that is an almost exact duplicate of a rails
method, and updated hmpās one to reflect the latest rails code (that
basically was the last fix).