Displaying 20 results from an estimated 3000 matches similar to: "ActiveRecord::find or Enumerable::find"
2006 Aug 01
2
has_many :through a belongs_to relationship
I have users who belong to a group. I also have a room that belongs to
a group. I want to use a has_many through association to link the room
and the users as such:
class Room < ActiveRecord::Base
belongs_to :group
has_many :users, :through => :group
end
The SQL generated for the search is incorrect:
SELECT users.* FROM users INNER JOIN group ON users.group_id =
groups.id WHERE
2006 Jul 07
4
Calling a method each time an ActiveRecord Object is accessd
Hi,
I know that it is possible to execute code each time data is saved into
a model by using the +validate+ method.
However, is there also a way to execute code each time the data is
accessed, not just when it is changed?
Bye,
Winsmith
--
Posted via http://www.ruby-forum.com/.
2006 Apr 19
2
Using Reflections to find out ActiveRecord class association
I want to find out what are the associations with another active record
class. So If my class is as below:
Class Component < ActiveRecord::Base
has_many :branches
end
class Branch < ActiveRecord::Base
belongs_to :component
end
and then I do
Component.reflections[:branches].active_record
I would expect that to be Branch but it is in fact Component.
The inspection of
2006 Jul 10
4
Session variable data validation
I''ve been using rails for about a month and I''ve been noticing that most
of my controller functions use values from my session variable. I find
that I write something like:
person = Person.find(session[:person]
if( person )
# ...
else
flash[:notice] = "unable to retrieve person"
redirect_to( :action => index )
end
It seems redundant to write similar code for
2006 Jun 04
6
Activerecord relations.
I''ve got two tables set up - Things and Users where Users have many
things and Things belongs to Users.
They''re connected by Things.user_id => User.id and Things.updated_by_id
=> User.id both in the Things model using Belongs_to and custom foreign
key for one of them.
Problem is when I''ve got the updated_by_id belongs_to I can''t add Things
using
2006 Mar 27
3
Enumerable?
Hi,
Can anyone please point me to some docs on Enumerable. I can''t seem to find
anything on how to use it.
Thanx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060327/0825d5e8/attachment-0001.html
2013 Jan 31
2
CollectionAssociation shadows Enumerable#count
Hi all,
I realize this behavior is by design, and in some respects the right thing
to do. It also pre-dates the addition of Enumerable#count. I''m wondering,
however, if it''s possible/desirable to allow the caller to access the
Enumerable versions under certain conditions. I originally wrote the up as
an issue, but was informed this would be the better venue. I''m
2006 Jan 23
3
prototype.js: enumerable mixin for hash broken
Hello everyone.
I am not sure if this is the right place to post, please redirect me
if there is a mailinglist more specifically dealing with prototype.js.
After playing around with the very inspiring prototype library I have
found a rather annoying thing, that makes the usefulness of the
Enumerable mixin for Hashes
questionable, if I am not totally wrong (again :-).
Here an example:
2006 Jan 23
4
Enumerable
Hi and sorry if this has already been discussed. I''m new on theese
lists, and I couldn''t find a way to search through them.
I have been looking at the sources of script.aculo.us and I''m rather
impressed by the Enumerable class. What I don''t get is why you choose
to extend Array.prototype with this addon. It seems like a rather
intrusive thing to do, if the code
2006 Jun 28
3
Add to enumerable
This might seem like a really daft question, but I couldn''t find an
answer anywhere. How do you add something to an enumerable object?
Something like
var first = $A(getElementsByTagName(''td''));
var second = $A(getElementsByTagName(''tr''));
first.PUSH(second);
where the PUSH is something unknown.
am i supposed to use inject here in some way?
Andreas
2017 Sep 22
13
[Bug 1185] New: counter flag proposal for sets and maps
https://bugzilla.netfilter.org/show_bug.cgi?id=1185
Bug ID: 1185
Summary: counter flag proposal for sets and maps
Product: nftables
Version: unspecified
Hardware: x86_64
OS: All
Status: NEW
Severity: enhancement
Priority: P5
Component: nft
Assignee: pablo at netfilter.org
2005 Dec 09
5
Prototype Enumerable, Array and Hash Documentation
Hey guys,
I recently published an article documenting some of the more useful
and interesting parts of Prototype''s Enumerable, Hash and Array objects.
You can find it here: http://encytemedia.com/blog/articles/
2005/12/07/prototype-meets-ruby-a-look-at-enumerable-array-and-hash
If you have any feedback or suggestions, fire away.
Cheers,
-Justin Palmer
2006 May 28
7
Join table not being populated
Hello,
I have the usual Categories and Products table scenario, mediated by a
Categories_Products join table. When I create a new Product and into a
given Category, I notice that my join table is not being populated.
Shouldn''t the join Categories_Products table be populated?
Thanks,
gk
--
Posted via http://www.ruby-forum.com/.
2006 Jul 28
11
Forum
Im making forum and i have problem with paths.
Here is code:
http://pastie.caboo.se/6389
With this code, it works. But its a bit weird to use so many paths
function. For every path i need to make new function. So can you suggest
me something.
Tables are like here:
http://wiki.rubyonrails.com/rails/pages/ForumExample
--
Posted via http://www.ruby-forum.com/.
2020 Apr 08
5
[Bug 1417] New: mapping to adjacent ranges is causing error in kernel 5.6, kernel 5.5 works fine
https://bugzilla.netfilter.org/show_bug.cgi?id=1417
Bug ID: 1417
Summary: mapping to adjacent ranges is causing error in kernel
5.6, kernel 5.5 works fine
Product: nftables
Version: unspecified
Hardware: x86_64
OS: All
Status: NEW
Severity: critical
Priority: P5
2008 Mar 25
6
Prototype 1.6.0.2 + Firefox 3 Enumerable problems
I am using Prototype 1.6.0.2 on Firefox 3.0b4.
The following does not work when I enter it in Firebug:
$A([1,2,3,4]).each(function(n) {alert(n);});
The above is just an example. Any array, using $A and any enumerable
method, returns the following:
TypeError: iterator.bind is not a function
Seems like some objects are not being extended correctly?
Using Prototype 1.5.0 on Firefox 3.0b4, this
2017 Mar 08
13
[Bug 1127] New: running nft command creates lag for forwarded packets
https://bugzilla.netfilter.org/show_bug.cgi?id=1127
Bug ID: 1127
Summary: running nft command creates lag for forwarded packets
Product: nftables
Version: unspecified
Hardware: x86_64
OS: Gentoo
Status: NEW
Severity: major
Priority: P5
Component: nft
Assignee: pablo at
2006 May 21
3
has_many :through with a polymorphic join
Hi,
Four tables: users, user_counties, uk_counties and us_counties.
Each user has many counties, and each county has many users, so I
decided to make user_counties a polymorph, so it can have counties
from different countries (each country requires a completely different
set of tables with a completely different set of properties, that''s
why there''s one table for uk_counties and
2019 Nov 12
6
[Bug 1382] New: nftables.py cmd leaking memory when ruleset contain mapping ip length to range with high limit 65535
https://bugzilla.netfilter.org/show_bug.cgi?id=1382
Bug ID: 1382
Summary: nftables.py cmd leaking memory when ruleset contain
mapping ip length to range with high limit 65535
Product: nftables
Version: unspecified
Hardware: x86_64
OS: Gentoo
Status: NEW
Severity: major
2006 May 10
7
has_many :through scope on join attribute
Hi
I have a has_many :through. It''s a basic mapping of
Project
id
....
User
id
....
TeamMembers
project_id
user_id
role
What I would like to do is have different roles so I can have in the project
model
has_many :core_members, :through => :team_members, :source => :user
but I would like to limit this to only those with the "core" role in the
team members table for