search for: fornol

Displaying 9 results from an estimated 9 matches for "fornol".

Did you mean: forcol
2010 Oct 14
7
undefined method?
I''m trying to learn rails as I go along, and having a bit of trouble. There is an undefined method cropping that I don''t know why rails thinks should be there. Firstly, I''m using rails 3, ruby 1.9.2 I have a controller with an index action This part works fine, but i am trying to add a comment form to the page that is rendered by that index action. Supposing my
2010 Oct 11
12
Need advice on controller / view
Need some advice. I''ve got two modules: artists and paintings. In my home page, I''ve got a 2nd page that says "Browse paintings", which displays ALL paintings of ALL artists. This is being rendered by paintings#index. In another page, I should show all paintings of a specific artist ONLY. Meaning, paintings from ONE artist. I cant use paintings#index for this anymore
2010 Nov 05
2
ActiveRecords queries: .where vs .find
I have a dataset, which contains a day column that I would like to retrieve results on. Is there any reason why daily_stats.where(''day = Date(?)'', dte).first returns and empty set, daily_stats.find(:first, :conditions => [''date(day) = ?'', dte]) returns the correct data and daily_stats.where({:created_at => (date.midnight - 1.day)..date.midnight}).first
2008 Sep 18
8
handling association changes? What's the best practice?
Hello all! I have a conundrum that I''m _sure_ someone else has already thought of and solved. How does one best handle the scenario of association object changes and data integrity? For example, if I have a standard ecommerce site that sells Products and people can have Orders and an Order has_many Products... then, what happens if Product #3 is part of Order #2 but at some point, the
2010 Feb 11
3
Parameterized ActiveRecord Associations: Any such thing?
Hi list, how are ya? So, my current project is just begging for the ability to have parameterized associations in my ActiveRecord classes. Basically I need something that is a cross between named scopes and standard associations (has_many specifically). I''m wondering if such a thing exists or, if not, if anyone else has an elegant, equivalent solution? Example: class Sprocket <
2010 Oct 13
3
using pg on snow leopard
I have a macbook running snow leopard. I recently installed postgresql 9.0 on it. I also installed pg with the following command: sudo env ARCHFLAGS=''-arch x86_64'' gem install pg The result was fine: Building native extensions. This could take a while... Successfully installed pg-0.9.0 1 gem installed Installing ri documentation for pg-0.9.0... Installing RDoc documentation
2008 Oct 10
2
Add hash to serialized column
Hey guys, I''m trying to merge a hash with another using the .merge! function. class User < ActiveRecord::Base serialize :preferences end This is what I end up with in the console: >> u = User.find(1) >> u.preferences.merge!{:test => 1} SyntaxError: compile error (irb):32: syntax error, unexpected tASSOC, expecting ''}'' u.preferences.merge!{:test
2008 Oct 10
2
Another "I'm I right" question...
I''m pretty sure that there''s a better way to do this: @roles = Role.find(:all) @selected_role = Role.find(@user.role_id) Can someone help me? --~--~---------~--~----~------------~-------~--~----~ 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
2010 Oct 12
2
STI and :through, not working?
Artist.first.medias returns all medias. Media is an STI. Media can be video or painting. How do I return all paintings of an artist? Only paintings, not videos? In my Artist model, I tried putting: has_many :paintings, :through => :medias In console, I do: Artist.first.paintings.all And I get: ActiveRecord::HasManyThroughSourceAssociationNotFoundError: Could not find the source