Displaying 5 results from an estimated 5 matches similar to: "Paginate with two tables ?"
2006 Jun 20
1
Preventing Dups in HABTM
I have a habtm that looks like:
report
has_and_belongs_to_many :subscribers
subscriber
has_and_belongs_to_many :reports
When I add a report to a subscriber, I have to run code like:
raise "already there, idiot!" unless
report.subscribers.find_by_id(subscriber_id).nil?
Is there a better way to avoid adding duplicative associations? has_many
:through seems like overkill for this
2019 Apr 26
2
Libvirt pool cannot see or create rbd clones
Hello everyone,
To increase my odds of finding an answer I also wanted to ask here.
This is my post from serverfault[1] in verbatim:
While trying to get a cloned disk running from my OS snapshot I run
into the problem that Libvirt cannot see existing images cloned from a
snapshot. Created via:
# rbd -p vmdisks clone vmdisks/coreos_2023@base vmdisks/coreos00.disk
The base image has the one
2010 Jul 13
1
NoMethodError in UsersController#show
So I am getting the error
NoMethodError in UsersController#show error
undefined method `feed'' for nil:NilClass
{"authenticity_token"=>"zalkdfsjfksjd;lfs;lfksdkf/2tPzo=",
"login"=>"session",
"password"=>"admin",
"commit"=>"Log in"}
Why is login being set to "session"? Instead of the
2010 Sep 29
2
Railroad problem with :through?
I have the following model layout:
class List < ActiveRecord::Base
has_many :subscribers, :through => :list_subscribers
has_many :list_subscribers
end
class Subscriber < ActiveRecord::Base
has_many :lists
has_many :lists, :through => :list_subscribers
end
class ListSubscriber< ActiveRecord::Base
belongs_to :list
belongs_to :subscriber
validates_uniqueness_of :subscriber_id,
2004 Aug 06
1
Client auth with mysql
+-Le 12/05/2004 14:20 -0500, oddsock a dit :
| Mathieu,
|
| This is a great idea, and I'm sure many people would like to take
| advantage of it. Since the release of 2.0.0, we've added an
| "authenticator" framework which allows us to create authentication
| modules for handling listener (client-based) authentication. We
| currently have one authentication module (htpasswd)