[Rails] User.find() unavailable for module when accessed through an test

2010-07-11 Thread martins
Hi, The methods I´ve put in GenericMessageFunctions are available and working within the Rails app, but I can´t access them from my tests. Why isn´t User.find() available from the GenericMessageFunctions module when it´s accessed trough a test? Should I include some library to get it working? $

[Rails] Bundler problems

2010-07-11 Thread ct9a
hi there, I have a few issues with bundler. 1) running "gem install bundler" in my project directory as a regular user is impossible due to permissions problem. I had to use sudo 2) running "bundle install" in my project directory as a regular user, I got the following permission problem. "Ins

Re: [Rails] Re: Apn on Rails gem

2010-07-11 Thread Amit Kumar
I mean device.id represents your token from apn_devices table. --- Regards, Amit Kumar Ruby On Rails Consultant +91 9890654102 Blogsite: http://amitbaraik.blog.co.in/ This e-mail is confidential and may be legally privileged. If you are not the intended recipient, please notify the sender immedia

[Rails] Re: uninitialized constant User::Authentication

2010-07-11 Thread Charles Wang
Daniel X Moore wrote: > I had the same problem, but restarting script/server fixed it. This help! -- 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

[Rails] Re: Email Testing with Cucumber and email-spec

2010-07-11 Thread Ben Mabey
You need to add "require 'email_spec'" before the "require 'email_spec/cucumber'". Also, for future cucumber related questions please use the cucumber mailing list: http://groups.google.com/group/cukes HTH, Ben On Jul 9, 10:00 am, Rails Learner wrote: > Hello Friends! > > I have been trying t

[Rails] Re: Rails equivalent of Delphi SetRange()

2010-07-11 Thread Mark Horrocks
Bb Serviss wrote: Many thanks to everyone who replied, this is a great forum. Delphi has been kind to me with the (visual component library) client data set which allows me to make a single query, then scope the remaining records in any way I see fit and loop through them, breaking out of the l

[Rails] Having problem with ckeditor rubygem

2010-07-11 Thread Michael Satterwhite
I've installed the ckeditor gem. I'm running rails 2.8.3 and have followed the steps in the README file for the gem. Everything seems to run without error through the <%= javascript_include_tag :ckeditor %> - except that to make it work I have to replace :ckeditor with "ckeditor". When I try to us

[Rails] Attachement_fu error when updating existing photos

2010-07-11 Thread Brian Rhiel
Hi, I am attempting to replace an exiting photo with a new one uploaded by the user. I am using attachment_fu and I am coming up with the following exception: can't convert nil into String /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/file_system_backend.rb:23:in `join'

[Rails] Re: Rails equivalent of Delphi SetRange()

2010-07-11 Thread Agoofin
> > And then in the controller: > > > @inactive = Item.inactive > > This looks like it will still fire off a query which is what I want to > avoid. The query would only fire (once) prior to rendering the view. For example, if you set the variable in the index action of the controller the query w

[Rails] Re: Re: null values...

2010-07-11 Thread Kenneth    
You have to show us the code in your view that has the form to make a comment. >From your description, params[:body] is obviously not being set to anything because you don't have a textarea or input box with the name "body". If the name of the textarea or input is named "comment[body]" then to

Re: [Rails] Re: null values...

2010-07-11 Thread David A. Black
On Sun, 11 Jul 2010, RubyonRails_newbie wrote: On 11 July, 21:23, "David A. Black" wrote: On Sun, 11 Jul 2010, RubyonRails_newbie wrote: i'm trying to add comments to a blog. I got it working, but i want to store the user too, so I added the user_id to the blogcomments table... Since th

Re: [Rails] Re: Active record relationship problems

2010-07-11 Thread Norm Scherer
Bob Proulx wrote: ... I don't think I can do a better job than the above. But I can add a few hints. Let's work with AAA, BBB, CCC where AAA belongs_to BBB and BBB belongs_to CCC. ... Hope that helps! Bob That does help. Thanks for the detailed explanation. Norm -- You received this m

[Rails] Re: Rake complains about missing "default" task

2010-07-11 Thread RichardOnRails
> maybe this is a Windows-specific issue? Good question. I copied the Tempfile to C:\ Ran my version, which added the working dir. to tmp.txt Ran fine. Ran original version -- same problem. So my speculation was wrong. Maybe that's because Windows has no real root. There's just the \ address

[Rails] Re: null values...

2010-07-11 Thread RubyonRails_newbie
I tried both :body and :id but the same issue: @blogcomment = Blogcomment.create(:id => params[:body], :user_id => session[:user_id]) On 11 July, 21:23, "David A. Black" wrote: > On Sun, 11 Jul 2010, RubyonRails_newbie wrote: > > i'm trying to add comments to a blog. > > > I got it working, but

Re: [Rails] null values...

2010-07-11 Thread David A. Black
On Sun, 11 Jul 2010, RubyonRails_newbie wrote: i'm trying to add comments to a blog. I got it working, but i want to store the user too, so I added the user_id to the blogcomments table... Since then, the page renders - but the comment is no longer stored. (the database stores the user id, bu

Re: [Rails] Re: Apn on Rails gem

2010-07-11 Thread Amit Kumar
token is your iphone id On 11/07/2010, Greg Ma wrote: > Amit Kumar wrote: >> Hi, >> >> Try this, i did it same way >> >> device = APN::Device.create(:token => " >> ") >> >> notification = APN::Notification.new device

[Rails] null values...

2010-07-11 Thread RubyonRails_newbie
i'm trying to add comments to a blog. I got it working, but i want to store the user too, so I added the user_id to the blogcomments table... Since then, the page renders - but the comment is no longer stored. (the database stores the user id, but not the body, blogpost id) def comment

[Rails] Re: Active record relationship problems

2010-07-11 Thread Bob Proulx
Norm Scherer wrote: > > HTML mail to a mailing list. Yuck! > > Sorry about that. I wasn't thinking. Please, please, please, try something different. You are still sending HTML email to the mailing list. > > You might have a better mental model if you use ActiveRecord modeling > > instead of r

[Rails] Re: Rails equivalent of Delphi SetRange()

2010-07-11 Thread lardawge
It might help you a bunch to think of it as Ruby and not Rails. Most of what your doing is writing Ruby and in many situations you will need to know how. Look through the Array methods here and you should get an idea of what can be done; http://ruby-doc.org/core/classes/Array.html Rails also inje

[Rails] Re: Rails equivalent of Delphi SetRange()

2010-07-11 Thread Mark Horrocks
Marnen Laibow-Koser wrote: > Huh?  A Rails "recordset" is simply an array.  You can take a piece of > it just as you would from any other Ruby array.  There's no explicit > SetRange because you can just use array slicing.  Thanks! I guess this is just what I am looking for. Setrange gives the

[Rails] Re: Rails equivalent of Delphi SetRange()

2010-07-11 Thread Marnen Laibow-Koser
Mark Horrocks wrote: > Marnen Laibow-Koser wrote: >> I'm still not completely sure I understand  exactly what you're doing,  >> but it looks to me like you're running onto trouble because you're  >  > If I want to re book courts after a game redraw part of the way through  > a competition, its nece

Re: [Rails] Re: Rake complains about missing "default" task

2010-07-11 Thread Hassan Schroeder
On Sun, Jul 11, 2010 at 9:51 AM, RichardOnRails wrote: > > I got took one of the first examples of the website I cited before, >> >http://jasonseifer.com/2010/04/06/rake-tutorial > and found that it didn't work "in any directory" as advertised. It does indeed work "in any directory" for me, but t

[Rails] Re: Rails equivalent of Delphi SetRange()

2010-07-11 Thread Mark Horrocks
Marnen Laibow-Koser wrote: > I'm still not completely sure I understand exactly what you're doing, > but it looks to me like you're running onto trouble because you're If I want to re book courts after a game redraw part of the way through a competition, its necessary to check the previous gam

[Rails] Re: Rails equivalent of Delphi SetRange()

2010-07-11 Thread Marnen Laibow-Koser
Mark Horrocks wrote: > Marnen Laibow-Koser wrote: > If you have 1000 >> records that you're paging through 10 at a time, there is no reason to >> fetch all 1000 if you only want to read 10. > > There aren't anywhere near that many. Its just that I change the view of > the records returned many

[Rails] Re: Rails equivalent of Delphi SetRange()

2010-07-11 Thread Mark Horrocks
Marnen Laibow-Koser wrote: If you have 1000 > records that you're paging through 10 at a time, there is no reason to > fetch all 1000 if you only want to read 10. There aren't anywhere near that many. Its just that I change the view of the records returned many times while testing for a game ti

[Rails] Re: Rails equivalent of Delphi SetRange()

2010-07-11 Thread Marnen Laibow-Koser
Mark Horrocks wrote: > I am currently converting a large Delphi webbroker application to RoR. > The Delphi application makes extensive use of client datasets and > setrange which can limit the range of records returned to a client > dataset in an SQL call without the overhead of making another SQL

[Rails] Re: Rake complains about missing "default" task

2010-07-11 Thread RichardOnRails
OK, I got took one of the first examples of the website I cited before, > >http://jasonseifer.com/2010/04/06/rake-tutorial and found that it didn't work "in any directory" as advertised. I did three things: 1 Upgraded the example so that it would work "in any directory" (I suspect it would work

[Rails] Re: Rails equivalent of Delphi SetRange()

2010-07-11 Thread Mark Horrocks
Thanks for your reply. A couple of further comments / question. I am a noob in Rails. > I like to model class methods for pulling specific information from > the database > > def self.inactive > find( :all, :conditions => ["inactive = ?", 1], :order > => :last_calibrated_on ) > end > And

[Rails] Re: Apn on Rails gem

2010-07-11 Thread Greg Ma
Amit Kumar wrote: > Hi, > > Try this, i did it same way > > >>> device = APN::Device.create(:token => " > ") > >> notification = APN::Notification.new >>> device.id= 'xxx' > >> notification.device = device > >> notifica

Re: [Rails] Apn on Rails gem

2010-07-11 Thread Amit Kumar
Hi, Try this, i did it same way >> device = APN::Device.create(:token => " ") >> notification = APN::Notification.new >> device.id= 'xxx' >> notification.device = device >> notification.badge = 5 >> notification.sound

[Rails] Re: Re: Re: need pdf gen which is support to Asian languages

2010-07-11 Thread Marnen Laibow-Koser
Mark Kremer wrote: > My previous response was incomplete, let me elaborate. > > While Unicode supports a lot of Asian characters it does not support all > Asian characters (they're working on it). It supports all Indic, East Asian, and Southeast Asian scripts. The only major issue is that there

Re: [Rails] Re: Active record relationship problems

2010-07-11 Thread Norm Scherer
Bob Proulx wrote: Norm Scherer wrote: HTML mail to a mailing list. Yuck! Sorry about that.  I wasn't thinking. I have three tables/models and I want to do a find on Reservations ordering the results by the names in Sitetype. Sql for tables and the mod

[Rails] Complex association

2010-07-11 Thread Greg Ma
Hello, I am working with 3 models: user, band, event. - A user has many bands and a bands has many users. - An event has one band, and a band has many events. the association I am trying to do is between users ands events. I tried has many through but the is not working because the foreign ke

[Rails] Testomg: doing def test_blah or test "blah" do

2010-07-11 Thread David Zhang
Hey, I'm wondering about the distinction between writing test methods like 1. def test_something_to_test end and like 2. test "something to test" do end It seems like there's no difference. I did notice, however, that #2 can't be done in a class that extends Test::Unit::TestCase, while it can

[Rails] Named_scope with dates

2010-07-11 Thread Greg Ma
Hi, I want to create a named scope that returns all the line where date is in X number of days. This is how it looks named_scope :in, lambda { |number| { :conditions => ["event_date = ?", number.days.from_now] } } My problem is that is compares the date with the hours, minu

[Rails] Re: Scaffold with no data ?

2010-07-11 Thread Agoofin
Did you rake db:migrate? On Jul 11, 7:31 am, DrSney wrote: > Hello, please help me with one little error that I have here. I have > created database structure, than generated scaffold for it (script/ > generate scaffold Artist). But when I try to use it, all i have is > this (db contains t record

[Rails] Re: Haml ... ending a line with a | (vertical bar)

2010-07-11 Thread Ralph Shnelvar
Phillip Koebbe wrote: > Ralph Shnelvar wrote: > Have you tried outputting a string: > > = "Some string ending with a vertical bar |" Ok! That did the trick. Thank you!!! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups

Re: [Rails] Scaffold with no data ?

2010-07-11 Thread Hassan Schroeder
On Sun, Jul 11, 2010 at 4:31 AM, DrSney wrote: > Hello, please help me with one little error that I have here. I have > created database structure, than generated scaffold for it (script/ > generate scaffold Artist). > What is wrong ? Why doesnt it show data ? What would you expect it to show i

[Rails] Re: Rails equivalent of Delphi SetRange()

2010-07-11 Thread Agoofin
There are a few ways to do this. One would be using a named_scope in Rails 2 or just plain scope in Rails 3 class Bookings < ActiveRecord::Base named_scope :discount, :conditions => { :discount > .5 } I like to model class methods for pulling specific information from the database def self.

[Rails] Re: How to update a Protected Attributes

2010-07-11 Thread Lasse Bunk
I have written a blog post on this subject: http://lassebunk.dk/2010/07/09/mass-assigning-protected-attributes-in-rails/ Hope this helps. Best regards, Lasse -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:

[Rails] Re: Multi databases in rails 3

2010-07-11 Thread jmamma
If you mean can rails connect to different db's like mysql, oracle, etc, then the answer is yes, but my guess is that you are asking if there is support to connect your app to different schema's. I'd like to know this too. My app has a master database, and then each customer has their own schema

[Rails] Scaffold with no data ?

2010-07-11 Thread DrSney
Hello, please help me with one little error that I have here. I have created database structure, than generated scaffold for it (script/ generate scaffold Artist). But when I try to use it, all i have is this (db contains t records): - Listing artists ShowEditDestroy ShowEditDes

[Rails] Apn on Rails gem

2010-07-11 Thread Greg Ma
Hi, I'm really not sure someone will be able to help me, but I have a problem with apn_on_rails. When I follow the exemple on the github page I have an error: >> device = APN::Device.create(:token => " >> ") >> notification =

[Rails] Re: Simple class question - new to ruby on rails

2010-07-11 Thread Kenneth    
Well from the looks of it your problem is this songfile = "songs.txt" songfile.each do |line| You are not opening the file "songs.txt" which is what you want to do I believe. Take a look at this http://ruby-doc.org/core/classes/IO.html#M002255 -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Re: Additional methods in models - how to access them?

2010-07-11 Thread Szymon Przybył
Wow, I didn't know that there are find_by_property methods already defined, ruby and rails are just great! :) I'm switching now from Kohana in PHP to Ruby on Rails, and I can say now, that ruby and rails are much better :) Thanks again! Simon On 11 Lip, 02:49, Kenneth     wrote: > But if you are

[Rails] Re: Re: Rails 3 convert time of created_at before saving to MySQL

2010-07-11 Thread Sharkie Landshark
I did properly migrate to Rails 3. I no longer have Rails::Initializer.run do |config| Inside class Application < Rails::Application is the only place I have config.time_zone = 'Bangkok' I restarted a few times as well. Sharkie Jeffrey L. Taylor wrote: > Did you restart your server? Did you

[Rails] Simple class question - new to ruby on rails

2010-07-11 Thread Chad Weier
I am getting an error with this code below.. basically its meant to read /jazz/j00132.mp3 3:45 Fats Waller Ain't Misbehavin' /jazz/j00319.mp3 2:58 Louis Armstrong Wonderful World /bgrass/bg0732.mp3 4:09 Strength in Numbers Texas Red from a text file, put it in an array and then display it but I a

[Rails] Re: Active record relationship problems

2010-07-11 Thread Bob Proulx
Norm Scherer wrote: > HTML mail to a mailing list. Yuck! > I have three tables/models and I want to do a find on Reservations > ordering the results by the names in Sitetype. Sql for tables and > the models look like the following: You might have a better mental model if you use ActiveRecord m