[Rails] [JOB] - Engineering Manager - 60% management, 40% hands-on (must love dogs)
Hi everyone! I'm working with a new client that was founded in 2013 and was officially profitable in January, 2016. They have an aggressive hiring plan for the next 2 years which includes going from 400 people to 1000 globally. They also plan on going public so this is the last year that significant amounts of equity will be given. The main HQ is here in Midtown Manhattan (New York, NY). Here is the actual job description. If you'd like more details, feel free to respond. I'm giving the abbreviated version to spare you the same, boring descriptions. ***Hiring a Lead Rails developer and hands-on manager to lead a team of 4. This is a very collaborative and diverse environment with a very specific niche that has grown into something special. This is the type of opportunity most engineering managers and pet lovers dream about. - *Architecture*: Solve problems in a way that paves the path for those coming after you. Propose innovative designs & develop robust solutions. - *Feature Delivery*: Write well designed, testable and reliable code. - *Code Quality*: Promote best practices to continually improve code quality and team productivity. - *Team-Oriented*: Collaborate with fellow developers to craft maintainable code and communicate the new capabilities to non-developer co-workers who will be excited to use new tools and offer great customer experiences *MUST HAVES:* - You have delivered and maintained on production software in a team environment - You are an experienced Ruby on Rails developer - You are comfortable working with Javascript and Angular / Vue / other javascript libraries. - You can design data models and optimize queries - - You believe in Testing and writing tests in your code. - You care about delivering a good customer experience and keep them in mind with every keystroke - You are able to easily dive in, understand, and build on an existing codebase - Bonus points if you have experience with ecommerce, data analysis, heroku and aws 100% medical and dental coverage from day 1. Extremely diverse environment, not ego-driven, more female engineers than you'd usually find in dev teams. Dogs everywhere - 15 to 30 well behaved little pooches at any given time. Tons of other perks, no max on compensation. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/183c72e1-3bc9-4fd9-a7ff-cd8f2cfc1bbf%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Rails] RoR Adv. developer/business partner opportunity
Early-stage startup seeking Adv. Ruby on Rails developer to be part of an EXCITING, NEW website that WILL BE the new benchmark in the job seeking/recruiting industry - Think about the impact LinkedIN has had on the business world...this will top that! We are two of the founding partners, looking for someone to be a third, equity holding partner. We ARE NOT LOOKING FOR FINANCIAL CONTRIBUTIONS. We're looking for expertise in RoR and web development to help lead this site to success. REQUIREMENTS: BS/MS in Computer Science, Engineering or related degree/experience, ability to work on own yet still be a team player, 5+ years experience with Ruby on Rails, and other applicable languages. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/735e4344-9ab1-4db3-8b90-677daa2bad4a%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Incorrect request.original_url returned by rails. Is this a Bug?
My home page is http://www.roomposts.com/infos/index, but request.original_url give me http://roomposts/infos/index Is this a bug? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a371fefe-3400-4401-a28b-ae2d5282011c%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Good Tutorial on RSpec
The only way I got a clue was http://pragprog.com/book/achbd/the-rspec-bookfor a tutorial with RSPEC check out www.railstutorial.org On Fri, Nov 2, 2012 at 11:00 AM, Adnan wrote: > Hey, > > Suggest me good resources about RSpec. Don't tell me to search in Google. > Trust me I did lot!! > > Thanks > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/YlcNIOG9HoMJ. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Evan Misshula Doctoral Student (Criminal Justice) CUNY John Jay "Let us reform our schools, and we shall find little reform needed in our prisons." John Ruskin, Unto This Last, essay 2 (1862) English critic, essayist, & reformer (1819 - 1900) "Instruction does much, but encouragement does everything." Johann Wolfgang Von Goethe www.snrg-nyc.org -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Ruby on Rails salaries in Berlin?
Hi Werner, Any recommendations on work visas for Americans for those of us without an EU passport? Thanks, Evan On Tue, Sep 25, 2012 at 11:52 AM, powi wrote: > Ah, forget my previous post, around ~1,5k will go to paying the bills, > food etc. so it's about 1k staying in your pocket for entertainment or > anything else that's not a required expense. > > > On Tuesday, 25 September 2012 18:48:46 UTC+3, powi wrote: >> >> Hi Werner, thanks for your helpful answers! >> >> When you say 30k, you mean after paying bills (house, food etc), right? >> >> On Tuesday, 25 September 2012 17:39:20 UTC+3, Werner Laude wrote: >>> >>> >>> Am 25.09.2012 um 15:35 schrieb powi : >>> >>> Santiago.. >>> >>> Hi Werner. >>> >>> Well I'm 24, I have a lot of experience generally on computers and web >>> development (~10 years). So what would you aim for if you were me? It's >>> going to be a full-time work, I'm going to be a part of the team. Someone >>> recommended ~50k (I'm a junior in Rails, but learning fast and built some >>> quite good things till now). >>> >>> >>> 50k is fine to start. >>> >>> >>> Also, what would you estimate the life there costs? I mean, the bills >>> (house, electricity, water, food, internet/phone)? >>> >>> >>> Rent: 500.- for 1-2 Rooms >>> Apartment with furniture 600.-/ 800.- >>> >>> >>> Food : 250.- >>> Transport: 60.- (public) >>> Haircut: 10.- >>> Party...??? >>> >>> when you earn 50k, no kids ..income taxes will be around 30%..but also >>> you have to pay sick- and pension insurance, etc. . So from 50k around 30k >>> will stay in your pocket.. which is not bad for 24 year young guy. >>> >>> Enjoy Berlin..culture is great. >>> o.k. weather is not like Barcelona..no siesta (8:00 - 17:30 straight >>> work), no outdoor sitting in the sun , running around in t-shirt etc..at >>> least not from now to next May. Can be be fucking cold in Jan - March >>> Communication can be mostly in english..no need to learn German..in the >>> beginning. >>> Berlin people are a little direct at times but helpful, but there are so >>> many foreigners.. >>> >>> Go for it.. Spain is not in a good shape right now... >>> >>> Werner >>> >>> >>> >>> Also, I heard the taxes there are quite high, something like 45%? >>> >>> On Monday, 24 September 2012 21:17:02 UTC+3, powi wrote: >>>> >>>> Hello all. >>>> >>>> I'm living in Spain, and I'm offered a job in a Berlin IT company as a >>>> Rails developer. I'm considered a junior developer (almost 1 year >>>> experience) but I think I'm pretty good for this time. >>>> >>>> I would like to ask what would be considered a good salary for such a >>>> position. I mean, what amount would be good and could make a decent life >>>> out of (apartment bill, internet, food etc.). I don't know if this matters, >>>> but I will relocate there. >>>> >>>> Also, does anybody knows what's the average IT salary in Berlin for >>>> Rails developers? >>>> >>>> Thanks, >>>> Santiago >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Ruby on Rails: Talk" group. >>> To post to this group, send email to rubyonra...@googlegroups.com. >>> To unsubscribe from this group, send email to rubyonrails-ta...@** >>> googlegroups.com. >>> To view this discussion on the web visit https://groups.google.com/d/** >>> msg/rubyonrails-talk/-/**fMKJkyZOTyoJ<https://groups.google.com/d/msg/rubyonrails-talk/-/fMKJkyZOTyoJ> >>> . >>> For more options, visit >>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >>> . >>> >>> >>> >>> >>> Werner Laude >>> webagent...@gmail.com >>> >>> >>> >>> -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/_Qho7U6JWC0J. > > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Evan Misshula Doctoral Student (Criminal Justice) CUNY John Jay "Let us reform our schools, and we shall find little reform needed in our prisons." John Ruskin, Unto This Last, essay 2 (1862) English critic, essayist, & reformer (1819 - 1900) "Instruction does much, but encouragement does everything." Johann Wolfgang Von Goethe www.snrg-nyc.org -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Rails] Rails Step by Step Tutorial for ubuntu
Installation_Ruby-on-Rails_for_Ubuntu-Linux-Mint_www-mirceagoia-com.pdf This is what I used. I was able to get it done. I ran into a problem and I just needed to uninstall and reinstall the gems. Good luck! Best, Evan Misshula On Mon, Jun 4, 2012 at 4:18 PM, Jeremy Walker wrote: > > > On 4 June 2012 21:05, Code Man wrote: >> >> Hello, >> >> I was wondering if anyone knows of a good step by step tutorial to >> install Apache + Mysql + PHPmyadmin + Ruby + Rails or any other web >> server to develop in rails in Ubuntu (Linux), I been to trying to >> install it but it is very hard because there is always something that >> goes wrong since there is so many things to install on the right way to >> make it work right, please help! >> > > Trying using google to search for "rails apache mysql tutorial". It brings > back lots of tutorials. The first one covers a lot of what you're asking. > > I would recommend reading a tutorial on each step individually, and getting > them working one by one, so you understand how they all work. One magic > tutorial that does them all will probably be a lot less reliable than a good > tutorial for each. > > Also, if you're just trying to get your application live, and you don't > really want to learn about the infrastructure, I'd recommend looking at > Heroku, which handles a lot of the pain for you. > > One final tip - you'll probably want to use Passenger, so google that as > well. > >> >> Cheers!! >> >> -- >> Posted via http://www.ruby-forum.com/. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk@googlegroups.com. >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. -- Evan Misshula Doctoral Student (Criminal Justice) CUNY John Jay "Let us reform our schools, and we shall find little reform needed in our prisons." John Ruskin, Unto This Last, essay 2 (1862) English critic, essayist, & reformer (1819 - 1900) "Instruction does much, but encouragement does everything." Johann Wolfgang Von Goethe www.snrg-nyc.org -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Ruby IDEs
I had used Netbeans for Java. Trying to use it for Ruby was a disaster. I would stick to an editor and get comfortable at the command line. (FYI I use Emacs but I know that is not the most popular choice.) On Tue, Feb 28, 2012 at 1:48 PM, FaBritze wrote: > You can use Eclipse with Aptana Studio Plugin, or as a standalone > Aptana version, but an text editor it's more usefull and i recommend > Sublime Text (http://www.sublimetext.com/) > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > -- Evan Misshula Doctoral Student (Criminal Justice) CUNY John Jay "Let us reform our schools, and we shall find little reform needed in our prisons." John Ruskin, Unto This Last, essay 2 (1862) English critic, essayist, & reformer (1819 - 1900) "Instruction does much, but encouragement does everything." Johann Wolfgang Von Goethe www.snrg-nyc.org -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] RSpec RoR3
I would suggest you look at Michael Hartl's free tutorial. It uses Rails 3 and is available at: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:install_rails Good luck. Best, Evan On Fri, Jul 15, 2011 at 6:43 AM, Sayuj Othayoth wrote: > Hi, > > Can any one can suggest me a good tutorial(s) on RSpec with rails3. I found > most of the tutorials use rails2 > > -sayuj o > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > -- Evan Misshula Doctoral Student (Criminal Justice) CUNY John Jay "Let us reform our schools, and we shall find little reform needed in our prisons." John Ruskin, Unto This Last, essay 2 (1862) English critic, essayist, & reformer (1819 - 1900) "Instruction does much, but encouragement does everything." Johann Wolfgang Von Goethe -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] subclasses with inherited_resources?
I'm trying out inherited_resources and so far so good. However, one problem I've run into is that it's very difficult to customize inherited_resource behaviour in subclasses. Looking through the source I see it uses things like undef_method and class_attribute. For example, if I have the following controllers: class ItemsController inherit_resources actions :new, :create def create # custom stuff here creat! end end class VideoController < ItemsController actions :new, :create, :show end videos controller will not respond to /show because inherited_resources undefined it in ItemsController. One thing I tried was to call inherit_resources again at the top of VideoController, so it reloads all of inherited_resources default actions, but also over-writes the custom :create action in ItemsController Am I overlooking something or is IR not supposed to be used for inheritance like this? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Speeding up rails boot time in development?
I recently switched from REE to ruby 1.9.2 and I was shocked by how long it takes for rails to startup. This isn't as much of an issue in production, but in development and test environments it's almost unusable because it's killing my workflow. for example, sometimes I need to run a single test or play around in the console. I've made sure I'm only loading gems I need and I've switched to the RVM patched version of 1.9.2 which is a big help. I'm also using spork for my tests. However, it still takes 20 + seconds to load a console. Also, spork is fantastic for unit and functional tests but can't be used for integration tests because spork requires config.cache_classes to be set to false, but integration tests are painfully slow with that setting. Is there anything else I can do to speed up the startup time, especially in the development environment? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] nested routes with namespaced models
Hi all. I'm having some trouble with nested routes and duplicate namespaces. I have an Article and Advert model, both with an associated Publication model: class Article has_one :publication end class Article::Publication belongs_to :article end class Advert has_one :publication end class Advert::Publication belongs_to :advert end Each Publication model is different enough that it makes no sense to have just one Publication model with STI or polymorphism. Also, there are numerous other models such as Cancellation, Payment etc that are namespaced for the same reason. here's the routes I have for the above resources: resources :articles do resource :publication, :module => :article end resource :adverts do resource :publication, :module => :article end this gives me article_publication_path and advert_publication_path which are fine. The problem occurs with polymorhic_url (used by form_for). Given [@article, @publication], it will try to generate article_article_publication_url which of course hasn't been defined. I've tried several of the options in the rails routing guide to no avail so for now, I'm manually specifying the path in form_for has anyone come across something similar or do you know of a potential solution? thanks, Ev -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Manipulating attributes between database retrieval and return from finder
Is there a way to manipulate the attributes of an ActiveRecord-based model after it is retrieved from the database but before it is returned from the finder? I have tried defining an after_find callback method but was unable to access attributes that come from the database from this method. I tried accessing them using self.an_attribute and read_attribute but both raised an attribute exception. I am trying to execute an upgrade-in-place strategy. When I deploy the latest version of my app one of the attributes on every existing record of a particular table will no longer be usable until converted to a new format. Rather than take the app down for 12 hours to upgrade the existing data I thought it could be upgraded on-access. Evan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Validating the presence of two associated objects from both models
> That way you can't save a conversation without assigning it a leader, > but the leader doesn't have to be saved yet. Well, that’s where I’m at right now. I’d like to be in a situation where Conversation validates that it has a Leader and Leader validates it has a Conversation before either is saved. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Framework choice for a new app
Since Merb is effectively merging into Rails and not the other way around I would suggest Rails. The reality is either way you will probably have to make significant modifications. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Understanding “create_association” a nd invalid objects
> the new object will only be saved if it > passed the validations, not that it won't be instantiated in either > case. How can I catch and handle a situation where this occurs (the new object is instantiated, but not saved)? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Validating the presence of two associated objects from both models
I have a model “Conversation” and a model “Leader”. A Conversation is always led by exactly 1 Leader. I’ve overridden Conversation’s “validate” method to validate the presence of an associated Leader model. If I add a similar validation to the Leader model, however, Conversations can no longer be saved on creation because the Leader model is invalid. On creation of both a new Conversation and new Leader how can I validate in each model that it is associated with the other? Is there a best practice? The closest I’ve come is to override Leader’s “validate_on_update” method to ensure the presence of a Conversation but that still allows new Leader objects to be created without a Conversation, filling my tables with junk. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] REST and context
hi all. I'm developing my latest rails app using a REST style. I've hit a bit of a problem with context however. Let's say I have an Item model. I'm using edit/update to handle the processing, but the model is edited differently depending on the context. sometimes all I'm doing is changing a 'status' attribute and don't need to show the entire form. In other cases I could be editing associated objects along with the main objects, and then there are user permissions to consider. Some user can edit some of the attributes and others can't. Even confirmation messages stored in flash after a successful update vary. All these operations are essentially an edit/update but the different contexts make it more complicated. For now I'm using separate actions for each type of update so for example, changing the status is handled by /items/mark_as_sold. Another way I could do this is to have a url parameter in the call to edit or update and process the request differently depending on the context but this gets messy. How do other developers handle these situations? Is there a 'rails way' to do it? thanks ev -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Understanding “create_association” and i nvalid objects
The documentation on the “create_association” method of the “belongs_to” association reads: > create_association(attributes = {}) > Returns a new object of the associated type that has been instantiated with > attributes, linked to this object through a foreign key, and that has already > been saved (if it passed the validation).* My expectation from this documentation is that calling “object.create_association” will return the newly created object if both objects save successfully and “false” if either object fails to save (due to failed validations, for example); or throw an error. My experience, however, is that “create_association” returns the newly created object regardless of whether it saved successfully or not. How can I catch and handle a situation where “create_association” instantiates and links a new object but is unable to save it? Rails 2.3.5 -- *http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#M001835 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Error: uninitialized constant MysqlCompat::MysqlRes
This didn't seem to fix the error for me. I still get 'uninitialized constant MysqlCompat::MysqlRes' Kyle Fox wrote: > To fix this, specify ARCHFLAGS when you install the 'mysql' gem: > > sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- > config=/usr/local/mysql/bin/mysql_config > > On Aug 27, 12:07�pm, Caleb Cullen cheers, -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: About Error handler
On Jul 21, 11:44 am, karthik k wrote: > Hi > > I am new to ruby on rails > I need to know one thing > Is there any way to externalize all the error messages in one file and > access > > -- > Karthik.k > Mobile - +91-9894991640 Do you mean the error messages from a model instance? You can just use ruby's standard file io methods to read and write a yaml file: File.open('errors.yml', 'w') do |out| out.write(my_obj.errors.full_messages.to_yaml) end to read it back in: errors = YAML.load_file('errors.yml') --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] ActiveRecord::Errors introspection
Hi everyone. I'd like to query the errors object to work out exactly what kind of error each attribute has. I'm doing this so that I can display a link to a relevant help page on certain types of errors. At the moment, I'm doing this by determining the type of error based on the error message. However, this is going to get messy when I translate my app into multiple languages. Does anyone know of a way to determine which validation caused a specific error? thanks Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: nil object in create_time_zone_conversion_attribute?
Michael Madrid wrote: > I just upgraded to 2.3.2 on Windows 7 and am getting the error. Using > file system gives a different error Unable to create directory, and > memcached won't install. Not sure what to do. I've seen this problem in 2.3.2 and now in 2.3.3. The above mentioned solution does not resolve this issue for me. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] ActiveRecord validations ignore SQLite3 timeout configuration
Hey all, Sorry if this is not the right place, but I could not find anywhere more appropriate. I ran into http://dev.rubyonrails.org/ticket/8811 over the past few days, and it's a very nasty bug. The fact is, validates_uniqueness_of and validates_existence_of (at least) do not respect the SQLite3 timeout database configuration, and cause SQLite Database Busy exceptions. The bug was moved to low priority two years ago, but I don't see how this is low priority. We have background threads with SQLite connections, so the validations must respect the timeout policy. Otherwise the system randomly blows up when trying to create new model instances (since that will trigger validations). It's not that the threats truly horde the database, they are quick running tasks. It's just that a single collision will cause an exception due to the validations not respecting the timeout policy. At present we are forced to re-write those validations in a safe way. Thoughts? Thanks for any advice or consideration. http://dev.rubyonrails.org/ticket/8811 -Evan Worley --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] ActiveRecord validations ignore SQLite3 timeout configuration
Hey all, Sorry if this is not the right place, but I could not find anywhere more appropriate. I ran into http://dev.rubyonrails.org/ticket/8811 over the past few days, and it's a very nasty bug. The fact is, validates_uniqueness_of and validates_existence_of (at least) do not respect the SQLite3 timeout database configuration, and cause SQLite Database Busy exceptions. The bug was moved to low priority two years ago, but I don't see how this is low priority. We have background threads with SQLite connections, so the validations must respect the timeout policy. Otherwise the system randomly blows up when trying to create new model instances (since that will trigger validations). It's not that the threats truly horde the database, they are quick running tasks. It's just that a single collision will cause an exception due to the validations not respecting the timeout policy. At present we are forced to re-write those validations in a safe way. Thoughts? Thanks for any advice or consideration. http://dev.rubyonrails.org/ticket/8811 -Evan Worley --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: :Partial and :locals question
Sorry just replied to you directly and not to the group.. Use the defined? method like... <% if defined?(child_index) && child_index %> -Evan Worley On Jul 16, 9:46 pm, Rodrigo Dominguez wrote: > what about using > > <% unless child_index.blank? -%> > Do something > <% else -%> > Do something else > <% end -%> > > Thank you > > Rodrigo Dominguez > > > > David Sousa wrote: > > Hello, > > > I want to be able to call a partial with and without a local. > > E.g.: > > 1 - <%= render :partial => "/contacts/phones/create", :locals => { > > :parent_form => contact_form, :phone => Phone.new} %> > > > 2 - <%= render :partial => "/contacts/phones/create", :locals => { > > :parent_form => contact_form, :phone => Phone.new, :child_index => "111" > > } %> > > > In my partial I have: > > > <% if child_index -%> > > Do something > > <% else -%> > > Do something else > > <% end -%> > > > The problem is that, when I don't pass the local child_index, the > > partial don't render and give me a error. What is the problem? > > > Thanks, > > David Sousa > > -- > Posted viahttp://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] URL-encoding and decoding on Rails
I have a URL parameter that has special characters on it, so I do URL encoding as such: my_url(:email => CGI.escape("someemail+extens...@mail.com") Now, I would expect to call a CGI.unescape(params[:email]) on the action receiving this parameter, and this is true according to my functional tests. But when I tested this on the browser, it failed because, apparently, I didn't need to do any URL-decoding, and when I did it gave me "someemail+extension mail.com". Is there a built-in URL-decoding on the controller side? If so, how is it that it doesn't work on my functional tests. I tested this on Safari and Firefox 3 browser, by the way. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Preventing read access to a model
In a model are there any methods that are called before providing access to the model? I'm exploring ways to enforce privileges in my app. Wondering if I can define some sort of "before" method in the model to prevent read access to the model unless certain conditions are true. Thanks. Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Associating ActiveRecord and non-ActiveRecord objects
Is it possible to define a model that is not backed by a database table and still relate other models to it? Will relations between instances of these models persist? For instance, say I have a Cat model that does not inherit from ActiveRecord and an Owner model that does. Can I assign a particular cat to an owner? The next time I load the app will that pair be remembered? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Authorization system recommendations
Adriano, Thanks for pointing out your post. I'm looking at the Authorization plugin now. After several more hours of research I've found a couple of resources that might help you, as well. A good, comparative overview of lots of authorization plugins http://steffenbartsch.com/blog/2008/08/rails-authorization-plugins/ Declarative Authorization plugin – well-designed authorization system that abstracts authorization declarations from application code http://github.com/stffn/declarative_authorization/tree Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Authorization system recommendations
Good morning. Our application has grown to the point where a more robust authorization system is needed. What Rails plugins or Ruby gems do you recommend? Our needs include: - defining multiple user roles which can use parts of the application in different ways - easy maintenance (preferably no generators or systems requiring manual code updating after initial install) We are already using authlogic for authentication. Thanks. Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Joining three objects uniquely using :has_many
Andrew, Changing the scope of validates_uniqueness_of to product_id solved my problem. Thank you. Evan On Feb 21, 8:32 pm, Andrew Bloom wrote: > I'm not sure I'm 100% clear, but it sounds like you are saying that a > Repair may only have one combination of Part/Product, and it just so > happens that this combination implies a Level. To me the validation > would be: > > class Repair < ActiveRecord::Base > belongs_to :level > belongs_to :product > belongs_to :part > > validates_presence_of :level_id, :product_id, :part_id > validates_uniqueness_of :part_id, :scope => [:product_id] > end > > Assuming I understand the problem, I think your confusion stems from > the fact that the level isn't part of what defines a Repair, its > simply an attribute of the Repair. It is really the Part and the > Product that you should be concerned with. > > On Feb 21, 7:24 pm, Evan wrote: > > > > > I just tried this code and was still able to create records with > > different levels for the same part/product combination. > > > class RepairClass < ActiveRecord::Base > > belongs_to :level > > belongs_to :product > > belongs_to :part > > > validates_presence_of :level_id, :product_id, :part_id > > validates_uniqueness_of :level_id, :scope => > > [ :product_id, :part_id ] > > end --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Joining three objects uniquely using :has_many
Andrew, Your last paragraph helps clarify it a little bit. I think you are correct in that I am chasing the wrong thing. I think that stems from not fully understanding the scope option of validates_uniqueness_of. The documentation for it is not clear. Evan On Feb 21, 8:32 pm, Andrew Bloom wrote: > I'm not sure I'm 100% clear, but it sounds like you are saying that a > Repair may only have one combination of Part/Product, and it just so > happens that this combination implies a Level. To me the validation > would be: > > class Repair < ActiveRecord::Base > belongs_to :level > belongs_to :product > belongs_to :part > > validates_presence_of :level_id, :product_id, :part_id > validates_uniqueness_of :part_id, :scope => [:product_id] > end > > Assuming I understand the problem, I think your confusion stems from > the fact that the level isn't part of what defines a Repair, its > simply an attribute of the Repair. It is really the Part and the > Product that you should be concerned with. > > On Feb 21, 7:24 pm, Evan wrote: > > > I just tried this code and was still able to create records with > > different levels for the same part/product combination. > > > class RepairClass < ActiveRecord::Base > > belongs_to :level > > belongs_to :product > > belongs_to :part > > > validates_presence_of :level_id, :product_id, :part_id > > validates_uniqueness_of :level_id, :scope => > > [ :product_id, :part_id ] > > endo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Mysql error unknown column 'columns.user_id'
Can you paste the lines where that error is raised? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Joining three objects uniquely using :has_many
I just tried this code and was still able to create records with different levels for the same part/product combination. class RepairClass < ActiveRecord::Base belongs_to :level belongs_to :product belongs_to :part validates_presence_of :level_id, :product_id, :part_id validates_uniqueness_of :level_id, :scope => [ :product_id, :part_id ] end --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Joining three objects uniquely using :has_many
So I could create a unique index consisting of product_id, part_id. Is it possible to then create a unique index consisting of level_id and the other index? I am using MySQL currently. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Joining three objects uniquely using :has_many
My join model is "Repair class." Its attributes are: - id (PK) - level_id (FK) - product_id (FK) - part_id (FK) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Joining three objects uniquely using :has_many
I've confused myself. I have three objects: level, product, part. Together they classify a repair type. - Replacing a part in a product has a level of difficulty associated with it. - The same part replaced in a different product has a different level of difficulty. How can I model an association among these? I have created a join model, "Repair class," and connected all three using :has_many through. However, this does not prevent multiple records where the part and product stay the same, but the level changes. In other words, I end up with multiple levels assigned to the same part/product combination which does not happen in the real world. What's the best way to proceed? Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] configure.gem image_science doesn't work
I have an app that requires 6 gems at the moment. config.gem works fine for most of them, but not for image_science. ImageScience is installed correctly, and the code works fine. But if I have the line: > config.gem "image_science" in my environment.rb, server (and rake tasks, etc.) all quit with the message: > Missing these required gems: > image_science image_science is installed correctly, in the same directory as all the other gems, and that directory (/Library/Ruby/Gems/1.8) is correctly listed among the directories output by the error message: > You're running: > ruby 1.8.6.114 at > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby > rubygems 1.3.1 at /Users/evan/.gem/ruby/1.8, /Library/Ruby/Gems/1.8, > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8 ... So I'm at a loss. Why does config.gem think this particular gem is not installed? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Changing drop_receiving_element behavior to make a GET request instead of POST
For those curious, I solved this problem by abandoning the drop_receiving_element helper and writing my own Ajax.Updater (see Prototype documentation) code on the page. Ajax.Updater takes a "method" option which allows you to specify get, post, put, delete, etc. On Nov 2, 8:16 pm, Evan <[EMAIL PROTECTED]> wrote: > Is it possible to specify which HTTP method to use in the > drop_receiving_element helper? I'm trying to follow REST best > practices in my app. On one page I have the user drop an icon into an > area which calls the "new" representation of a particular resource. > However, drop_receiving_element sends the request as POST which is not > allowed. How can I change the method so it makes a GET request? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Changing drop_receiving_element behavior to make a GET request instead of POST
Is it possible to specify which HTTP method to use in the drop_receiving_element helper? I'm trying to follow REST best practices in my app. On one page I have the user drop an icon into an area which calls the "new" representation of a particular resource. However, drop_receiving_element sends the request as POST which is not allowed. How can I change the method so it makes a GET request? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Can not figure out why validation fails
Thanks, Mark. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Can not figure out why validation fails
Mark, Thanks for the information about automatic validations in has_many- related models. Can you point me to documentation on this? I'd like to learn more about how it works. Thanks. Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Can not figure out why validation fails
Daniel, I did not notice that warning about validates_presence_of before. Thanks for bringing it to my attention. Your thought process helped me understand better what is going on. Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Can not figure out why validation fails
Good morning. I can not for the life of me figure out why validation of objects of one of my classes always fails. http://pastebin.com/m754b5bee The highlighted lines are where I am getting errors. The unit test fails on the highlighted line every time. If I remove :olive_oil_sources from validates_presence_of validation works fine. I have also tried writing my own validate method: if ( olive_oil_destination.nil? || olive_oil_sources.empty? ) errors.add_to_base("blah") end which also fails even though each individual piece of the if expression evaluates true when run under console. Why is this object not validating? Driving me nuts. Thanks. Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Many to Many Question
Scott, I think you would have to: -Find all users belonging to a company (@company.users.find(:all)) -Iterate through each user and add their bug count to a total bug_count = 0 @company.users.find(:all).each do |user| bug_count = bug_count + user.bugs.size end If you have a large company or lots of users you may be better off writing a custom SQL statement and letting your database do the counting. Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Data modeling references
Do you know of any great books, references or other works that teach data modeling? I am especially interested in learning more about resolving complex relationships. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Ensuring both objects in a one-to-many association are not saved without the presence of the ot
I guess the question I was really getting at is how can I validate the presence and association of both objects before they are saved? I feel more confident when there is code in the model itself to ensure the integrity of the data rather than depending on each programmer to place every save in a transaction block. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Ensuring both objects in a one-to-many association are not saved without the presence of the ot
Oh wait. I think I just got it. Start a transaction, save the primary object thus getting the id, save the secondary object, end transaction. Right? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Ensuring both objects in a one-to-many association are not saved without the presence of the ot
Even with transactions can I save the object containing the foreign key without saving the primary object first? In other words, can I save the object that requires the foreign key to be present if I don't have the foreign key because the primary object has not yet been saved, thus generating an id for it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Ensuring both objects in a one-to-many association are not saved without the presence of the other
Hello. I have an object which is related to a second object through has_many. The second object (obviously) is related to the first through belongs_to. I want to ensure that neither object is saved to the database without the presence of the other. How can I do this? Thanks. Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Adding attributes to subclasses created using polymorphic associations
Good evening. I have a class, CustomerRequest, which I have subclassed into three other classes, all different types of customer requests. I chose to use polymorphic associations to map the subclasses in my database. For one of the subclasses, InstallRequest, I have generated a new model and defined a new table in the generated migration. However, when I instantiate InstallRequest in the console the only attributes that appear in the object are those of the superclass, CustomerRequest. The columns I defined in the subclass' migration do not appear as attributes of the object. -I have verified that the subclass, InstallRequest, is defined as a subclass of CustomerRequest, not ActiveRecord, in the model file. -I have verified that the database has been migrated to the latest revision. Is this expected behavior or is there a bug in my code? I was expecting the subclass to have all of the attributes of the superclass as well as those defined in the migration file generated for the subclass. If this is expected behavior how can I map the columns of the subclass' table to the subclass objects? Thanks. Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---