Displaying 20 results from an estimated 600 matches similar to: "Delegates and building associations"
2004 Feb 17
2
A bit OT: LDAP and AD interoperability with LDAP as master
Hi all,
First, sorry for posting this mail in a Samba-list, I first posted it to
ldap@umich.edu which should be a general LDAP discussion list and also to
OpenLDAP mailinglist. So far I didn't got a single reply in any of those
lists but that's probably because this issue is much more AD-related than
plain LDAP. And we know that beside MS the Samba developers know most
about AD :-) So
2012 Jul 28
1
`build_association` produces DB-queries
Let `User.has_one :profile`. I''ve always thought that `@user.build_profile`
is a cheap thing to do - it''s just creating a new object without persisting
it. But, in fact, it does 2 queries to the DB: `BEGIN` and `COMMIT`.
In my app I have an admin users#index page where users'' details can be
edited, and to simplify the code I build a profile whenever it''s
2007 Jun 13
14
Do delegates work properly in Drb mode?
Hi folks,
I have several models that index well in Drb mode.
However, I have one scenario where it works in normal mode, but not in
Drb mode.
model A
field :one
end
model B
belongs_to :a
field :two
delegate :one, :to => :a
acts_as_ferret :fields => { :one => {}, :two => {} }, :remote => true
end
If I leave off the :remote parameter, it works. Or, if I don''t
2010 Nov 19
1
Help: delegated association 'App' returning ActionDispatch::Integration::Session instead
class Foo < ActiveRecord::Base
has_one :bar
delegate :app, :to => :bar
end
class Bar < ActiveRecord::Base
belongs_to :app
def self.attribute_column_names
return @@attr_columns if defined?(@@attr_columns)
readers = content_columns.map { |n| n.name.intern } -
[:created_at,:updated_at]
@@attr_columns ||= readers.map { |k| [k, "#{k}=".to_sym] }.flatten
end
2007 Jun 27
5
Help: I need community delegates
Hi all,
I''m very happy to see how quickly the Puppet community is growing and
how pleasant and helpful everyone is. It seems like people are
starting to handle a lot of the questions on the email lists and IRC,
which is great because it means I can focus more on development and
planning.
There are a few areas that don''t seem to be meeting the community
needs, though,
2001 Dec 07
3
more on cbq parameters
While I''m thinking about that review of howto changes, here are a few
other responses about things I don''t believe. I''ll be interested in
more info if anyone has any.
====
[from new doc]
Besides being classful, CBQ is also a shaper and it is in that aspect
that it really doesn''t work very well. It should work like this.
I''ve not noticed that it
2008 Apr 21
0
Lost Polymorphic Associations in development environment causes delegate :blah, :to => to fail
Hi All
I have been struggling with this issue for a long time now. And before
I began to describe the problem its important to know that this
problem happens only in Development environment.
I am using Rails 2.0.2, here are my associations
class User
has_many :comments
has_one :profile, :as => :profileable
delegate :email, :to => :profile
end
First call to comment.user.email works
2007 Aug 08
1
Mocking Time, delegating to original object
In my Unit tests, I run into the all-too-common problem of
Time.expects(:now) being called by Benchmark before the method is
unmocked.
Instead of messing around with the teardown order, I decided to modify
the Expectation with a new method, .stops_mocking.
Here are the changes I use, including a few monkey patches to push
relevant objects down to where I want them, all wrapped up in a big
ugly
2008 Sep 11
0
session/marshalling
I have the following problem with marshalling/saving a model to session.
I have 4 models: User, Profile, Customer, Membership. Membership belongs
to the other three models, and User, Profile and Customer all have a
has_one :through => :memberhsip association to each other. Now I have a
registration process over several steps, including the creation of all 4
models. Partially the validation of
2020 Oct 19
3
Dovecot docker auto-responder - delegate to external SMTP
Hi all,
I have dockerized my dovecot setup. Everything works fine besides
auto-responder using sieve.
Issue is that the my dovecot docker image does NOT come with a SMTP
which could be used for outgoing mail.
My SMTP setup (postfix) is in another image/container.
I want to keep it that way, so that dovecot and postfix have separate
images.
So basically I have 2 containers running in the
2005 May 11
6
Need help with GSSAPI authentication
Client: Windows XP pro, in an AD 2003 domain, running SecureCRT 4.1.11.
I've also got MIT Kerberos for Windows installed on the client, and Leash
shows that my tickets ARE forwardable.
Server: Solaris 8 Sparc server, with MIT Kerberos (krb5-1.4.1), and
OpenSSH 4.0p1.
I've created two AD accounts, and extracted keys mapped to
"host/hostname.domainname.com at REALM.COM" and
2012 May 26
2
before_create is after_validatation :on => :create , when it should be before_validation :on => :create
In ActiveRecord''s callbacks, methods within a before_create callback
are called after the validation, but before the model is created.
This was an intentional design decision, but I think it was the wrong
one. What do you think?
When I think of before_create, I think of before_validation :foo, :on
=> :create, but, by default, before_create is synonymous with
after_validation :foo,
2005 Nov 21
1
[OT] DNSguruz pl help: whois structure, delegation & handling delegation with Tinydns.
List:
Sorry for posting to this list but could not find step by step
instructions anywhere nor get any concerned list to respond.
Newbie to DNS technicals but can work with instructions if given
in ./configure for complete idiots ;-)
1. I have taken a static IP from my ISP 203.134.221.162 and the ISP has
put up an entry in APNIC whois (please check the same)...to me it seems
incomplete, as it
2006 Feb 15
8
Agile book - getting confusing error
Working through the beginning phase from the Agile book on
''Administration''
undefined method `hashed_password='' for #<User:0xb7911324>
...
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1498:in `method_missing''
#{RAILS_ROOT}/app/models/user.rb:12:in `before_create''
2008 Jun 29
3
Working around/with Restful Authentication
I''m using Restful Authentication, and the code to create a user is
pretty straight forward - there is a before_save action and a
before_create action:
before_save :encrypt_password
before_create :make_activation_code
But for some reason when I try to create a user programmatically in
the controller like this:
User.new(:email =>
2007 May 05
3
DB trigger vs before_create
Hello everyone,
I''m having trouble figuring out which approach is better.
I have the following tables: products, orders and line_items.
Every time an Order is placed, the quantity field in the products
table has to be updated for each LineItem in the Order. One option is
to use DB triggers which is not as portable as using before_create in
the Order model. But with before_create I cannot
2006 Apr 21
2
Using before_create and conflicting setter method...
Hi,
I am having trouble using before_create when I have an specialized
setter method:
before_save :set_campaign_start
#-----------------------------------------------------------------------
-------
def set_campaign_start
self.campaign_start = Time.now
end
# We want the date to always start at midnight
2006 Feb 15
1
self in before_create
Hi, I am having a small problem concernig how to access local variables in
before_create. I am not sure how to really form this question but here goes:
I am wondering why this works
def before_create
self.last_logged_in = Time.now
self.created = Time.now
end
but this doesn''t
def before_create
@last_logged_in = Time.now
@created = Time.now
end
The latter fails
2006 Mar 01
1
Using delegate templates
Ok, it looks like what I need to do is use a delegate
template, but I can''t find anything anywhere online.
Has anyone ever used this feature before and could
possibly explain it to me please?
--
Topher Fangio
fangiotophia@gmail.com
http://www.fangiotophia.com
Website Specialist
Fangiotophia Designs
(325) 660-7141
2006 Mar 17
0
Generating WSDL when using delegated or layered distpatching
All,
I can''t seem to come up with the appropriate incantation to Rails return
WSDL for my web service. I am attempting to use layered dispatching. For
direct dispatching, I can simply access
http://localhoss:3000/controllername/service.wsdl and all works as
advertised. When I configure for layered dispatch, the same invocation
returns "unknown action".
I''m