search for: subscriber_id

Displaying 5 results from an estimated 5 matches for "subscriber_id".

2006 Jan 10
0
Paginate with two tables ?
...paginate.. Here is code. ##### SQL create table subscribers ( id integer not null auto_increment, name varchar(32) not null, surname varchar(64) not null, create_timestamp DATETIME not null, modify_timestamp DATETIME not null, primary key (id)); create table contracts ( id integer auto_increment, subscriber_id integer, service_id integer, sign_date timestamp, representative varchar(128) not null, constraint fk_subscriber foreign key(subscriber_id) references subscribers(id), primary key(id)); There is something like this in controller: @subscriber_pages, @subscribers = paginate :subscriber, :per_pag...
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 application. Thanks -- View this message in context: http://www.nabble.com/Preventing-Dups-in-HABTM-t1819715.html#a4961706 Sent from the RubyOnRails Users forum at Nabble....
2010 Jul 13
1
NoMethodError in UsersController#show
...rom_users_subscribed_by, lambda { |user| subscribed_by(user) } private # Return an SQL condition for users followed by the given user. # We include the user''s own id as well. def self.subscribed_by(user) subscribed_ids = %(SELECT subscribed_id FROM subscriptions WHERE subscriber_id = :user_id) { :conditions => ["user_id IN (#{subscribed_ids}) OR user_id = :user_id", { :user_id => user }] } end -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on...
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)
2010 Sep 29
2
Railroad problem with :through?
...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, :scope => :list_id end and get the following error: railroad -i -l -a -m -M | dot -Tpng | sed ''s/font-size:14.00/font-size:12.00/g'' > doc/models.png /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/whiny_nil.rb:52:in `method_missing'': undefined...