similar to: how to 'delete' an object from an association collection in-memory only

Displaying 20 results from an estimated 20000 matches similar to: "how to 'delete' an object from an association collection in-memory only"

2011 Jul 29
7
Rails and Service Oriented Architecture (SOA): any downsides?
Hey folks, I like what I''m reading about improved performance via Service Oriented Architecture for my Rails app. Stepping in that direction will require some code reorganization, though. Has anyone regretted the time invested in Rails SOA or suffered any other drawbacks that might -- from a business perspective -- have disinclined them from going SOA? Lille -- You received this
2010 Jul 07
1
what is a session stored via the active_record_store option unique to?
Hi, After a bunch of snooping in AWDWR and Railsguides I can''t reach a good understanding to the following question: What is a session stored via the active_record_store option unique to? In other words, how does rails bind the user to their session under the active_record_store option? This concern has arisen in the following way... ...I have two use levels in my app: 1) authenticated
2012 Sep 20
7
jQueryUI autocomplete (Rails 3.1): can't get source as url to work
Hey, I''m able to duplicate everything in Ryan Bates'' screencast on jQueryUI autocomplete (#102<http://railscasts.com/episodes/102-auto-complete-association-revised>), except for the piece that calls the server for completion data. Here is my view html: <input data-autocomplete-source="/searches" id="search-markets"
2009 Oct 29
4
Unknown column 'quotes.organisation_id' in 'where clause': SELECT * FROM `quotes` WHERE (`quotes`.organisation_id = 1036)
Hi, I have a small app that needs to keep track of quotes, and organisations. An organisation can either be the unit who finally receives the goods (the end_user) or and intermediary (customer) (and in some cases both) An Organisation will (hopefully :) ) have many quotes; and a quote can belong to an organisation, either as a customer or as an end_user or both. So the quotes table
2009 Sep 01
5
Deep nested associations on the same Model
This could be a lot simpler than I think and I''m just missing something obvious! I''m working on a creative collaboration app whereby one user could submit a Story and this can then be forked by another user and worked on seperately. To acheive this I have a has_many association within the same Story model as such: class Story < ActiveRecord::Base has_many
2010 Jan 12
8
tips on how to write a controller test for models associated with currently logged in user
I have a controller test here: http://gist.github.com/275616, which works fine when account is an independent model, however I want: an account to be a property of user, ( and created and associated when a user is) when the user goes to /account/edit it should on edit the account of the logged in user - I can make rails do this, but I''m utterly baffled how I should alter this test to
2006 Jan 02
3
Altering the accessor of an association collection
I want to be able to do something like this (for example): class Person < ActiveRecord::Base has_many :friends def friends(living_in = :uk) # filter based on parameters here end end Is there any way I can redefine the accessor for an association whilst still being able to get the values? Basically, I''m looking for an equivilent of read_attribute() for associations. --
2010 Dec 07
10
Advice on data design idea
I''m about to embark on a project and am seeking advice on my approach. I have an automotive site that needs to have shared categories. I''ve checked out different nested set, ancestral, acts_as_tree, acyclic plugins but feel they don''t exactly fit. So I am about to roll my own simple solution. Any feedback as to whether this looks good is appreciated. Essentially I
2009 Jun 25
7
Join Tables
I just have a few questions about join tables. From my understanding the following applies (correct me if I''m wrong): 1.Join tables are always named with the names of the two associated tables, in alphabetical order, separated by an underscore. 2.The foreign key fields are named with the name of the table they are referencing, with _id appended. 3.The foreign key is referencing a
2009 Oct 23
2
validates_uniqueness_of across multiple rows?
Ok, that''s not the best subject line, but I couldn''t think of a concise way to describe what I''m trying to do. I''ve got two models. Grouping simply contains an id and a few other attributes (e.g. rating). A grouping can contain many elements which are stored the Element model. A set of elements is tied together by a grouping_id. An element can be one of
2010 Sep 11
10
Having difficulty with threaded comments, using acts_as_tree
I''ve been having problems making threaded comments for the last few days. Mainly with creating children and displaying the children. Currently, I have comments shown at the bottom of my articles show view. The top level comments work, but I do not really know how to implement a way for users to "reply" to the top level comments and take them to a form (the comment
2009 Sep 01
9
Ruby on Rails Project Opportunities
Hi I am currently recruiting for a number of freelance contracts and permanent internal positions, both junior and senior, for Europe''s largest and most dynamic Ruby on Rails development projects, offering the chance to work alongside some of the industry''s leading figures in the Web 2.0 development community. Selected locations include Germany (eg Berlin, Munich, Hamburg,
2010 Jul 09
6
deployment question: has anyone deployed w. sqlite?
Hi, I''d like to make a demo version of my app available, but I''m not ready to get into database stuff, yet. Has anyone ever deployed with sqlite (what I used to develop my app)? If so, what hosting service(s) would you recommend? Thanks, Lille -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this
2010 Feb 01
3
validating both sides of a has_one relationship breaks pickle/machinist tests
A lot has been posted about validation issues with associations, however, I don''t see this issue addressed specifically. ex: class Foo has_one :schedule, :dependent => :destroy validates_presence_of :schedule class Schedule belongs_to :foo validates_presence_of :foo_id this creates a circular dependency that breaks test frameworks like pickle and machinist. At first I was
2010 Dec 28
14
cerating multiple cjeck boxes using array
i have a registration form ,i want to store data in corresponding user table in that hobbies field ,i want to store all hobbies in one column so i take multiple check boxes and store in one array all checked values for that i am using below tag,but not working,please any suggestion <%= check_box(:user ,:hobbies,:value =>''Games'') %>Games <%= check_box :user ,
2010 Oct 11
8
Nooby Stuck - "has_and_belongs_to_many" relationship
trying to set up a "has_and_belongs_to_many" relationship would very much appreciate the help, not sure what im doing wrong at all. Scheme.rb class Scheme < ActiveRecord::Base validates :schemename, :presence => true belongs_to :user has_many :levels, :dependent => :destroy has_and_belongs_to_many :works end Work.rb class Work < ActiveRecord::Base
2013 Sep 17
4
Rails 4 deprecation of in-place edit methods for collection associations
Hi everyone! For those of you who are not noticed the in-place edit method for collection associations are broken in the current rails release - 4.0.0, and here''s what is cooking in the rails master https://github.com/rails/rails/commit/1a40be02113287d9a003f8224e91b9f623857f4b and this https://github.com/rails/rails/pull/12227 In short: it looks like things like has_many.reject!{},
2009 Jun 22
5
has_many through , or habtm , using form
i think there ara two ways of relate products and categories , basically i want to fix one product(e.g hp dv7....) to some categories (notebook,17"notebooks...) i made a table named categorization(incuding category_id,product_id fields) then in models i write these codes below class Product < ActiveRecord::Base has_many :categories, :through => :categorizations
2010 Jan 25
15
database design question: building features
I am trying to decide between two different database architectures for an application to manage properties. For capturing the property features, I have two options: a single model/table with all the features as fields, or a set of joined models - property, feature, feature data. (see attached ERD diagram) OPTION A Properties name address has_pool has_doorman has_etc. (a bunch of values, not all
2009 Jun 07
4
How to access parent property
Hi, I am having difficulties accessing parent properties/attributes from the child. Anyone could shed some lights onto this? Heres a sample code: class Parent < ActiveRecord::Base :has_many => :childs @connector def before_save @connector = ''some connector object'' 0..9.do |count| self.childs << Child.new self.childs[count].connector =