Hallo Erwin.
yes I want the data from week with the id 47 and 48 (in this case)
Am Dienstag, 13. November 2012 15:23:02 UTC+1 schrieb Erwin:
>
> with the project_id you get already all the corresponding bookings , right
> ?
> @bookings = Booking.find_all_by_project_id(params[:id])
> => [#, # 2
with the project_id you get already all the corresponding bookings , right ?
@bookings = Booking.find_all_by_project_id(params[:id])
=> [#, #]
and you want the data associated with the week and the project ? right
why don't you join the tables data uisng .join ?
Le mardi 13 novembre 2012
I actually did mention quantity in my model: "The Orders_Products table has
the two id columns (order_id, product_id) and a quantity column".
On Thursday, March 1, 2012 12:51:47 PM UTC-5, Max wrote:
>
> i'm very new to this too so this may be wrong (shameless disclaimer)
>
> but
>
> you men
i'm very new to this too so this may be wrong (shameless disclaimer)
but
you mentioned quantity in your question but there's no reference to
quantity in your description of the models. I would think that you'd
also need a quantity field in the Orders_Products model/table to
support that and
On Wed, Feb 15, 2012 at 11:55 AM, Bodo Kist wrote:
> Thanks.
>
> I forgot to mention that one solution is discussed on
>
>
> http://stackoverflow.com/questions/9174513/rails-has-many-through-form-with-checkboxes-and-extra-field-in-the-join-model/9191867#9191867
>
> When I try this approach I got
Thanks.
I forgot to mention that one solution is discussed on
http://stackoverflow.com/questions/9174513/rails-has-many-through-form-with-checkboxes-and-extra-field-in-the-join-model/9191867#9191867
When I try this approach I got an error message from inside the original
routine below:
Couldn't
On Jan 26, 9:50 am, Rodrigo Pavano wrote:
> Hello!
>
> Im using ruby 1.9.2 and Rails 3.0.3.
>
> I have the following models
>
> class Property < ActiveRecord::Base
> class Feature < ActiveRecord::Base
> class DefaultFeature < Feature
> class CustomFeature < Feature
> class PropertyFeature < Acti
Not fully understanding your problem, have you tried named_scope?
On Jan 26, 9:50 am, Rodrigo Pavano wrote:
> Hello!
>
> Im using ruby 1.9.2 and Rails 3.0.3.
>
> I have the following models
>
> class Property < ActiveRecord::Base
> class Feature < ActiveRecord::Base
> class DefaultFeature < Featu
Hi Jayoshi,
But I cannot figure out how to supply all Test id's to
create the full
set of tests in the Findings table
Can you please specify what you need to populate in finding table. as
you have mentioned that you need to specify test ids in finding table
that is a
Scott Holland wrote:
[...].
>
> Ok, so now I have the polymorphic relationship set up and working
> fine...
>
>
> class Event < ActiveRecord::Base
> has_many :guestlists
> has_many :notes, :as => :notable
> end
>
> class Guestlist < ActiveRecord::Base
> belongs_to :event
> has_many :n
> Then your associations, as given in your original posts, do not match
> your DB schema. According to your DB schema, you don't need has_many
> :through; instead, you need a polymorphic association such that a note
> can belong to either a guestlist or an event.
Ok, so now I have the polymor
Scott Holland wrote:
>
>> ...which would be event.notes , since event has_many notes through
>> guestlists.
>
> An event also has notes, so that gives me just the notes for the event.
>
> In my notes table I have:
>
> event_id (if the note is about an event)
>
> guestlist_id (if the note is
> ...which would be event.notes , since event has_many notes through
> guestlists.
An event also has notes, so that gives me just the notes for the event.
In my notes table I have:
event_id (if the note is about an event)
guestlist_id (if the note is about a guestlist)
I need to seperate th
Patrick Doyle wrote:
> guestlists is plural.
>
> event.guestslists returns a list of Guestlist records.
>
> If you want all of the notes for all of the guestlists for a
> particular event, (as an array) you might try something like:
>
> event.guestlists.collect(&:notes).flatten
>
> A true Ruby
guestlists is plural.
event.guestslists returns a list of Guestlist records.
If you want all of the notes for all of the guestlists for a
particular event, (as an array) you might try something like:
event.guestlists.collect(&:notes).flatten
A true Rubyista could probably tell you a much more
can you post the table definition?
On Oct 20, 11:15 pm, Scott Holland
wrote:
> Hi there,
>
> I want to do this, but it's driving me nuts:
>
> event.guestlists.notes
>
> i.e. to find all the notes from all the guestlists from a particular
> event.
>
> class Guestlist < ActiveRecord::Base
> belo
now this is one of the weirdest
action which has:
logger.info curent_user.user_groups.inspect
in itself runs properly
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this gro
now i found in console, that it works in development mode, also
running from mongrel is fine
>> u=User.find(8)
=> #> u.user_groups
=> [# wrote:
> forgot to mention
>
> as i am moving app to new server where i am testing it with REE, i am
> getting these errors:
>
> happens on this line on User mo
forgot to mention
as i am moving app to new server where i am testing it with REE, i am
getting these errors:
happens on this line on User model:
self.user_groups.include?(UserGroup.find(gr))
--~--~-~--~~~---~--~~
You received this message because you are subscr
Using :conditions will work but the problem is that you've just
introduced duplication between the conditions and the named_scope.
Anyway, here's my initial pass at trying to solve this:
https://gist.github.com/82c50486bc38b7d7c880
It only works for conditions at the moment which was enough for
Hi Pankaj,
I don't know how to do this with named_scope, but maybe you'll like
this:
class User
has_many :pending_friends, :through => :friendship, :source => :friend,
:conditions => {'friendships.is_accepted' => 'true'}
end
However, you can't do sth. like
@user.pending_friends << @f
I'm also trying to find a way of doing this if anybody has any
suggestions; will report back if I find a way of doing it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this gr
22 matches
Mail list logo