similar to: beating a dead horse - proper association selection

Displaying 20 results from an estimated 1000 matches similar to: "beating a dead horse - proper association selection"

2013 Sep 14
2
the problem of buying and selling
I own a lot to the folks on r-help list, especially arun who answered every of my question and was never wrong. I am disinclined to once again ask this question, since it is more arithmatic than technical. But, having worked 2 days on it, I realized my brain is just not juicy enough.... Here is the problem. Trust not for freedom to the Franks--- They have a king who buys and sells. -
2006 Jan 03
2
help me understand association attributes
I have a model with a belongs_to association. The first model is called Thing and the associated model is User. I''m attempting to assign the user to the thing. To accomplish this I used a before_save method, like this: class Thing < ActiveRecord::Base belongs_to :created_by, :class_name => "User", :foreign_key => "created_by_user_id" def before_create
2006 Dec 06
2
validates_uniqueness_of where scope euqals created_by "magic" field
I have the following ActiveRecord objects: class Recipe < ActiveRecord::Base has_many :ratings, :dependent => true . . . end class Rating < ActiveRecord::Base validates_uniqueness_of :created_by, :scope => :recipe_id belongs_to :recipe, :counter_cache => true . . . end The created_by field on Rating is implemented as a "magic" field similar to this:
2006 Sep 09
2
why doesn't this work (setting attribute in "before_create")
Hi, Can anyone spot why the below doesn''t work? * I have a "created_by" column in my create table in the dB * I have a "before_create" line, which definitely gets called * I tried a few different ways to set the "created_by" attribute in the model but it doesn''t seem to work, i.e. doesn''t appear in the database
2014 Mar 19
1
Beating a dead horse
Sorry to do this .... AGAIN Every year or two I get stuck on this same problem involving excluding. Seems I learn how its done then 2yrs later I've totally forgotten and when I look up my notes ... this new need is just different enough that they don't apply. Here's the problem. (Simplified... and I've skipped some of the repetitive output) On remote ls A/ a/ b/ c/ d e on
2004 Nov 11
1
Beating a dead horse - Roaming profiles / logon scripts
Using samba 3.0.8 and Suse ES 9.0 I'm having problems getting roaming profiles/local profiles and logon scripts on a Win2k or WinXP workstation working correctly. My bdc is supposed to be doing the authentication against my PDC\LDAP server. Even when I enable Only allow local profiles on the XP machine it will logout a domain samba user with a sorry no roaming or local profile available
2009 Aug 04
6
forms, javascript and ajax - hopefully an easy question
Right now I have a simple form hooked up. Now that the form is smooth and functional, I want to add a feature that I''m not sure how to implement. After a user modifies a form, I''d like to have a visual cue appear somewhere to show that the form has been changed and needs to be saved. It could be a red div at the top of the screen - anything - it is doesn''t matter. Just
2006 Apr 03
3
Retrieving a record using created_by
Hello, Thank you all in advance for your help with this. Environment: Windows XP Pro (Development only) Ruby 1.84 Rails 1.1.0 SaltedHashLoginGenerator Plugins: file_column, userstamp I have a user table per the salted_hash_login generator. I have an orders table that has a column named created_by that is updated by the userstamp plugin. I am trying to retrieve all of the orders for a single
2006 Jan 20
11
Userstamp Plugin
I''m pleased to announce a new plugin for Rails: Userstamp. You can read my blog post at http://www.delynnberry.com/articles/2006/01/20/userstamp-plugin and/or read all about it at the perminant page http://www.delynnberry.com/pages/userstamp. Any comments or suggestions for improvement are much appreciated. -- DeLynn Berry delynn@gmail.com http://www.delynnberry.com A dump of the Readme
2007 May 06
5
Comparing polymorphic property to same object fails
I''ve got a polymorphic association on one table. I assign to it in the controller. This is handling invitations of users to tasks in a task management application. If the user issuing the invitation is the user being invited (ie the user assigned themselves to a task), I want to activate the invitation immediately in the model. The trouble is that this: if self.assignable ==
2011 Nov 04
5
Beating the Top-Posting Dead Horse
On Fri, Nov 4, 2011 at 12:44, BeeRich <beerich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > As for top posting, that is an old school habit. Er, no it isn''t. You young punks wouldn''t know old-school if it bit you in the diapers! Now get off my lawn! ;-) Seriously though, REAL old-school quoting is interleaved point by point, with anything irrelevant trimmed
2006 Feb 26
3
Rails Naming Conventions
DB field names: If I have a table that references 2 or more separate users from my users table, is there a recommended naming convention for this situation? In my case, I have 3 users associated with a record in my projects table: requester_user_id created_by updated_by I could name one of them "user_id", and then projects.user would work I guess, but wouldn''t work
2006 Apr 11
5
Multiple "has" in ActiveRecord
Please excuse a newbie question, but I couldn''t find anything by searching the archives. What I want to know is how to have multiple references to the same class/table within a class. For example, let''s say I have a table called People: create table people ( id serial8 primary key ,name); which just holds a list of the people in the database. Then I have another
2011 Nov 18
1
What does :count actually mean in assert_select?
Hi guys, I tried reading up the RSPEC Book (Dec 2010) and googled a bit but I could not find anything. I''m using Rspec2. Example: spec/factories/categories.rb ====================== FactoryGirl.define do factory :category_intakes, :class => ''category'' do name ''intakes and filters'' description ''airfilters and
2006 Sep 09
13
best way to add "created_by" entries to all tables???
Hi, I want to automate somewhat the addition of created_by/updated_by fields on my models (i.e. to include username). What''s the best/recommended way to do this? Would it be to: a) Find out how to extend the ActiveRecord::Base itself (I haven''t extended a class before yet) b) Use a plugin type approach where you have to add a tag manually to each model file which then
2006 Jul 05
8
Beating the authentication horse (dead yet?)
Guys, I''m frankly overwhelmed by the number of Rails authentication options(?) out there...from ActiveRBAC to acts_as_authenticated to LoginEngine and so on...so many options, yet on resource I''ve found really distinguishes between each. This is sad, as authentication and user management is really an area where some Rails simplicity pixie dust could be a real boon to
2008 Sep 25
1
question about exception
Hi In the controller I have the function def convert_sd_ticket_to_incident ServiceDeskTicket.close_ticket(sd_id,created_by_id,modified_by_id) Incident.convert_sd_ticket_to_incident(sd_id,created_by_id,modified_by_id) end Now in the ServiceDeskTicket model def self.close_ticket(sd_id,created_by,modified_by) begin ActiveRecord::Base.transaction do
2006 Feb 18
5
Date formatting error
Hi All, I''m a bit stumped. All I''m trying to do is format a date and I get an error. Details below. I have a partial to list all "notes" associated with a "client" with the following code. <% for note in @client.notes %> <hr /> <%=h note.note_text %> Posted on <%=h note.created_at.strftime("%I:%M") %> by <%=h
2007 Aug 03
0
acts_as_paranoid and Association Extensions (has_one troubles)
Hi... Isn''t there a proper way or hack/workaround for the following? * For the example with unfortunate disabilities.. look below,,, Usage of has_* (associationmethods) do {def with_deleted AccociatedModel#with_scope} {Paranoid''s#find_with_deleted}... The has_one associations give me a nil object when invoking it with Model.association_OBJECT.with_deleted. Has_many does like
2007 Dec 28
1
logistic mixed effects models with lmer
I have a question about some strange results I get when using lmer to build a logistic mixed effects model. I have a data set of about 30k points, and I'm trying to do backwards selection to reduce the number of fixed effects in my model. I've got 3 crossed random effects and about 20 or so fixed effects. At a certain point, I get a model (m17) where the fixed effects are like this