Re: [Rails] Re: How much logic should I add to my ActiveRecords

2011-06-22 Thread Chirag Singhal
Also, you can't define default scope with lambda until Rails 3.1 You can use "unscoped" if you want to override default scope -- Chirag http://sumeruonrails.com On Thu, Jun 23, 2011 at 11:35 AM, Colin Law wrote: > On 23 June 2011 00:33, Andrew Skegg wrote: > > Chirag Singhal writes: > > > >

Re: [Rails] Re: How much logic should I add to my ActiveRecords

2011-06-22 Thread Colin Law
On 23 June 2011 00:33, Andrew Skegg wrote: > Chirag Singhal writes: > >> >> >> It may sound silly simple, but why not just defined a named scope for that > and be done with it. >> Assuming you are on Rails 3 something like this should work: >> >> scope :active, lambda {where(["created_at > ?", 10

Re: [Rails] Best Models Associations suggestions

2011-06-22 Thread jay.galli...@gmail.com
There are two things I like about has_many :through. First, it causes me to think about and try to name the relationship. Second, it treats the join model as a first class entity, formalizing the relationship - so i can say book.catalog_entries as well as book.subjects.

Re: [Rails] Re: Checking if file_field is empty?

2011-06-22 Thread Jen
Thanks for the tip on active models! I don't know much about the different types but I think this may be the answer to my problems. Though I have not been very exact with giving exact line nums etc for my errors I do understand if statements and what I am trying to do. Thanks to everyone else

[Rails] Re: How much logic should I add to my ActiveRecords

2011-06-22 Thread Andrew Skegg
Chirag Singhal writes: > > > It may sound silly simple, but why not just defined a named scope for that and be done with it. > Assuming you are on Rails 3 something like this should work: > > scope :active, lambda {where(["created_at > ?", 10.days.ago])} > > > Bingo! Although given what

[Rails] Re: Self referential has many through - belong to association dows not work ???

2011-06-22 Thread Andrew Skegg
Hans writes: > > Thanks for the advices > > Matt do you mean that I should use > relationship.related_person=Person.new instead of changing the foreign > key directly > If so, is that a general requirement when updating foreign keys ? I think he means: person = Person.first other_person = Per

[Rails] Re: Trying to run "cap deploy" with my Rails app; ssh keys

2011-06-22 Thread Andrew Skegg
David Zhang writes: > On the server, it's actually ~/.ssh/authorized_keys2.  That serves the same purpose, right? To tell you the truth - I do not know. I would assume so. > Also, do the id_rsa, id_rsa.pub, and known_hosts files in the ~/.ssh/ on *the server* matter at all? They do for th

[Rails] Re: Trying to run "cap deploy" with my Rails app; ssh keys

2011-06-22 Thread Andrew Skegg
David Zhang writes: >On my new machine, my global git config email is different from the email I used to use.  So, in the .ssh/authorized_keys file on the server, the key is *exactly* the same, but the email at the end is different - does this actually matter? Ahh yes - of course it matters.

[Rails] Re: Trying to run "cap deploy" with my Rails app; ssh keys

2011-06-22 Thread David Zhang
> On Wednesday, June 22, 2011 1:07:45 AM UTC-4, Andrew Skegg wrote: > > 3) Shell into the above server and check the users .ssh/authorized_keys > file. > It should contain a line identical to you local id_rsa.pub key. > On the server, it's actually ~/.ssh/authorized_keys2. That serves the sam

Re: [Rails] Oracle Schema

2011-06-22 Thread Colin Law
On 22 June 2011 21:38, Tom Allison wrote: > Is there a way > I have one Oracle database. > I would like to divide Development, Test, Production up by SCHEMA within the > same database. > Is there something in the database.yml that I can configure for this? I have not used Oracle but this link

[Rails] Re: Trying to run "cap deploy" with my Rails app; ssh keys

2011-06-22 Thread David Zhang
On Wednesday, June 22, 2011 1:07:45 AM UTC-4, Andrew Skegg wrote: > > I have been tinkering with such things lately, and learning a lot. There > are > a few things I would check first: > 1) Have a look at the contents of your .ssh/id_rsa.pub key. > 2) Check your config/deploy.rb script to see

[Rails] Re: Oracle Schema

2011-06-22 Thread Tim Shaffer
Well since schemas in Oracle are basically just users, you could have a different user for prod/test/dev. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrai

[Rails] Oracle Schema

2011-06-22 Thread Tom Allison
Is there a way I have one Oracle database. I would like to divide Development, Test, Production up by SCHEMA within the same database. Is there something in the database.yml that I can configure for this? -- You received this message because you are subscribed to the Google Groups "Ruby on

Re: [Rails] Best Models Associations suggestions

2011-06-22 Thread Tim Shaffer
On Wednesday, June 22, 2011 1:21:06 PM UTC-4, gallivan wrote: > > I like has_many through with a CatalogEntry join model. Devil's advocate here... what do you gain in this example by using a has_many :through instead of has_and_belongs_to_many? Is one ever really going to neeed to access a Cata

[Rails] Railtie initializer and generators

2011-06-22 Thread Florent
I am creating a gem for a Rails project and I got some troubles to understand how generators and initializers work. I would like to initialize my module loading some stuff from the database from models related to tables my gem should create with a migration file. Problem is : if I create a Railtie

Re: [Rails] Best Models Associations suggestions

2011-06-22 Thread jay.galli...@gmail.com
I like has_many through with a CatalogEntry join model. ## example Page call ## Page.last.chapter.book.subjects.first ## models ## class CatalogEntry < ActiveRecord::Base belongs_to :subject belongs_to :book end class Book < ActiveRecord::Base has_many :catalog_entries has_many :subje

Re: [Rails] Re: multi form for_

2011-06-22 Thread Walter Lee Davis
On Jun 22, 2011, at 12:16 AM, Chirag Singhal wrote: Check out this RailsCast - http://railscasts.com/episodes/196-nested-model-form-part-1 It will get your concepts right, the syntax will need to change a little bit because that was for Rails 2 I just worked through this last night, ther

Re: [Rails] (partial) asset host deployment

2011-06-22 Thread Martin Wawrusch
not sure if this works in rails 2.3, but in 3.0 you could use jammit and jammit-s3 for that to deploy assets on amazon. jammit-s3 is now smart enough to not redeploy unchanged files. On Wed, Jun 22, 2011 at 8:11 AM, Hassan Schroeder < hassan.schroe...@gmail.com> wrote: > Situation: Rails 2.3.x

[Rails] (partial) asset host deployment

2011-06-22 Thread Hassan Schroeder
Situation: Rails 2.3.x app being actively developed for an artist, which includes lots of large hi-res images. It makes no sense to include all those images in every deployment, so an asset host + rsync would seem to be an easy answer. On the other hand, the CSS and JavaScript files change freque

[Rails] Best Models Associations suggestions

2011-06-22 Thread rajeevkannav
Hello All I am working on my new project. in that my requriments are like this Subjects have many books, book belongs to subjects Books have many Chapters, Chapter belongs to Books Chapter have many pages, page belongs to Chapters Is that fine or it could be done better Ways Thanks in advance -

Re: [Rails] how to test...

2011-06-22 Thread Colin Law
On 22 June 2011 15:19, Tom Allison wrote: > ... > So I don't have the Rails logger inherently in my code. > What approaches can I use to provide this logging into my command line > process libraries? I have never done that. Did you try the process described in the debugging guide for using an al

Re: [Rails] Ruby on Rails developer

2011-06-22 Thread thiagocifani
I also can work remotely, but if it is necessary I think I can effort with 2 months in the client place! The only problem is that I am brazilian! Is there a problem? On Wed, Jun 22, 2011 at 6:15 AM, Nikita Demeshchenko wrote: > Hello Shiva, > I can work remotely if it's possible. > Please let me

Re: [Rails] how to test...

2011-06-22 Thread Tom Allison
On Tue, Jun 21, 2011 at 8:37 AM, Colin Law wrote: > On 21 June 2011 13:21, Tom Allison wrote: > > On Sat, Jun 18, 2011 at 5:13 AM, Colin Law > wrote: > >> > >> On 18 June 2011 10:04, Tom Allison wrote: > >> > I have a not-so-rails process that I'm developing in Rails. > >> > The Rails part is

[Rails] Re: Self referential has many through - belong to association dows not work ???

2011-06-22 Thread Hans
Thanks for the advices Matt do you mean that I should use relationship.related_person=Person.new instead of changing the foreign key directly If so, is that a general requirement when updating foreign keys ? Andrew How do I avoid the caching/stale record process I have tried to make an extra save

Re: [Rails] Re: Select Multipal friend from facebook

2011-06-22 Thread Pravin Mishra
Hi Sandip, thanks for write,but with this gem i need to create my own connecting pages(with EMAIL and PASSWORD). so I need something to implement OMNIAUTH. authentication of app is complited. Thanks + Pravin Mishra On 22 June 2011 16:03, sandip ransing wrote: > use contacts gem > > O

Re: [Rails] RoR TDD

2011-06-22 Thread Peter Bell
For general testing in Rails, I like the (short but good) chapter in Eloquent Ruby - gets you thinking about testing right and it isn't overwhelming. >From there, Rails test prescriptions is a great intro to testing and TDD for Rails developers, and finally you're going to want to pick up a copy

Re: [Rails] Re: Inviting authors for Ruby on rails programming site.

2011-06-22 Thread Michael Pavling
On 22 June 2011 12:38, Matt Jones wrote: > And we're not even going to get into how bogus hosting copies of > Railscasts (again, without any attribution or even a link back to the > site) is... The Rails logo is copyright too... and they don't very much like people using it for their own purposes

Re: [Rails] RoR TDD

2011-06-22 Thread Everaldo Gomes
Hi, this is a basic tutorial, but I recommend because it teaches how to develop in Rails using TDD: http://ruby.railstutorial.org/chapters/static-pages#sec:TDD. I hope this could help. Everaldo On Wed, Jun 22, 2011 at 6:40 AM, Sayuj Othayoth wrote: > Hi, > > How can I start with TDD in RoR.

Re: [Rails] Ruby on Rails developer

2011-06-22 Thread Nikita Demeshchenko
Hello Shiva, I can work remotely if it's possible. Please let me know if it's suitable for you and I will send my CV. Sincerely Mykyta Demeshchenko On 21.06.2011, at 22:52, SHIVA KUMAAR wrote: > We are looking for a Ruby on Rails developer for our direct client > requirement.. Location: San Fr

[Rails] RoR TDD

2011-06-22 Thread Sayuj Othayoth
Hi, How can I start with TDD in RoR. I'm new to this framework and I know basic idea about RoR. I hope this is the time to start with TDD. Please help me on this. Pls let me know about good tutorial. thank you sayuj -- You received this message because you are subscribed to the Google Groups "

[Rails] Re: How much logic should I add to my ActiveRecords

2011-06-22 Thread Matt Jones
On Jun 22, 3:29 am, Colin Law wrote: > On 22 June 2011 06:36, John SB wrote: > > > > > > > Thanks for that, I simplified things a bit for the post.  There is > > actually a reason to have an explicit status. > > > I'm going ahead with adding the after_find callback but I think I've > > run into

[Rails] Re: Inviting authors for Ruby on rails programming site.

2011-06-22 Thread Matt Jones
On Jun 22, 12:10 am, A Sarkar wrote: > Dear Friends, > > http://rubyonrailsprogrammer.orgis  a PR rank 4 site among 5 million > searchers on the Google is dedicated  to promote Ruby on rails programming > throughout the world. The site is getting 100s of visitors every day. We are > inviting aut

[Rails] Re: Self referential has many through - belong to association dows not work ???

2011-06-22 Thread Matt Jones
On Jun 21, 4:27 am, Hans wrote: > I'm trying to set up a self-referential relationship, as described in > this great video > -http://railscasts.com/episodes/163-self-referential-association > - and it's mostly working, but not entirely. > > My self-referential relationship describes relationshi

[Rails] Re: Problem with special characters and CSV upload

2011-06-22 Thread Sebastian
file.temp is an object. I have a form where a csv can be uploaded, but it is never stored. That's why I use tempfile. That means that I probably have no path to use in that method. BUT, the open and foreach method for the CSV class is working with an object whenever I don't have a german special c

[Rails] [X-Post] Sudhir SB becomes the 100th Member of IndiaRubyConsortium (www.indiarubyconsortium.com)

2011-06-22 Thread Satish N Kota
All, I would like to take pleasure in updating about IndiaRubyConsortium. Our Membership has crossed 100 and Sudhir SB from Mumbai is our 100th member. This has been an achievement as it is just a 25 days old group and has achieved 100 memberships. We would like to thank all the groups and group

[Rails] Spork, Rails and testunit

2011-06-22 Thread Michel Pigassou
Hi. I'm trying to use Spork (actually spork-testunit, last git version) with Rails 3. My setup is correct, I manage to launch Spork (through bundle exec) and testdrb. But I cannot succeed to have my models reloaded. Spork-testunit's doc says to put the loading commands in the prefork block, whi

Re: [Rails] Re: Select Multipal friend from facebook

2011-06-22 Thread sandip ransing
use contacts gem On Wed, Jun 22, 2011 at 3:43 PM, Pravin Mishra < diatm.pravin.it.07...@gmail.com> wrote: > Hi everyone, > I had not get any solution. I want to develop my site like that > http://developers.facebook.com/blog/post/464/ > No one had developed application like that. If any one have

[Rails] Re: Select Multipal friend from facebook

2011-06-22 Thread Pravin Mishra
Hi everyone, I had not get any solution. I want to develop my site like that http://developers.facebook.com/blog/post/464/ No one had developed application like that. If any one have any clue OR any suggetion, Please forward. THANKS PRAVIN MISHRA On 22 June 2011 07:33, Pravin

[Rails] Re: Problem with special characters and CSV upload

2011-06-22 Thread Chirag Singhal
What does file.tempfile return? If it is a file object, then we have a problem, we need to pass in file path here. So call path on the file object and pass that as the first argument. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To vi

Re: [Rails] Re: `exec': wrong number of arguments (ArgumentError) when using bundle exec

2011-06-22 Thread Iván Hernández
On 06/22/2011 05:18 AM, Chirag Singhal wrote: When it says try using bundle exec... it means that you have to prefix the command with that Use it like this 'bundle exec rake db:migrate' -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To

[Rails] Re: Problem with special characters and CSV upload

2011-06-22 Thread Sebastian
Exactly the same error! It says 'No file to upload' The documentation says that the encoding option for CSV is available for OPEN, FOREACH, READ and READLINES. So both, open or foreach, should work, or? On 22 Jun., 10:26, Chirag Singhal wrote: > How about this: > > file = params[:file] > CSV

[Rails] has_many :through and has_one :through associations

2011-06-22 Thread Wael Nasreddine
Hello, First I'm using Rails 3.1 from the 3-1-stable branch updated an hour ago. I'm developing an application where I have 3 essential models User, Company and Job, Here's the relevant part of the models: class User < ActiveRecord::Base has_many :companies_users, class_name: "CompaniesUsers"

Re: [Rails] best references (tutorials & howtos) for an experienced Rails Developer to start building Facebook Apps with RoR?

2011-06-22 Thread exelstu...@gmail.com
Hi Amritpal, Check http://www.ruby-toolbox.com for a gem to help you interact with Facebook. That site seems to have aggregated the best ruby gems sorted in popularity per category by downloads. Best, Pardeep. On 6/22/11 12:43 AM, "amritpal pathak" wrote: > > > On Wed, Jun 22, 2011 at 3:39

[Rails] Re: Problem with special characters and CSV upload

2011-06-22 Thread Chirag Singhal
How about this: file = params[:file] CSV.foreach(file.tempfile, {:encoding => "rb:UTF-32BE:UTF-8", :headers => false, :col_sep => ";"}) do |row| @newhash << {:var1 => row[0], :var2 => row[1]} end -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:

[Rails] Re: Problem with special characters and CSV upload

2011-06-22 Thread Sebastian
I tried these both: CSV.open(file.tempfile, "rb:CP850:UTF-8", {:headers => false, :col_sep => ";"}) CSV.open(file.tempfile, {:headers => false, :col_sep => ";", :encoding => "rb:CP850:UTF-8"}) it says 'No file to upload' ! I used the following code to show the encoding of my file: utf8 = File.

Re: [Rails] Re: How much logic should I add to my ActiveRecords

2011-06-22 Thread Colin Law
On 22 June 2011 08:38, Chirag Singhal wrote: > It may sound silly simple, but why not just defined a named scope for that > and be done with it. > Assuming you are on Rails 3 something like this should work: > scope :active, lambda {where(["created_at > ?", 10.days.ago])} I tend to agree, it is m

Re: [Rails] best references (tutorials & howtos) for an experienced Rails Developer to start building Facebook Apps with RoR?

2011-06-22 Thread amritpal pathak
On Wed, Jun 22, 2011 at 3:39 AM, Pravin Mishra < diatm.pravin.it.07...@gmail.com> wrote: > Hi everyone, > what are your best references (tutorials & howtos) for an experienced > Rails Developer to start building Facebook Apps with RoR? > Thank you for this post.Also curious to know about it. >

[Rails] Looking for Developer

2011-06-22 Thread TimRoss
Hi all- We are looking for a developer/programmer to build a custom social networking website sollution for our particular needs (target audience). We currently have some graphics, a logo, and are completing a visual mockup of what we want it to look like. This would be a full featured private soc

[Rails] Ruby on Rails developer

2011-06-22 Thread SHIVA KUMAAR
We are looking for a Ruby on Rails developer for our direct client requirement.. Location: San Francisco, CA *** There is also an option for Telecommute, first 2 months you have to work in the client place, after that Telecommute will be an option..*

[Rails] best references (tutorials & howtos) for an experienced Rails Developer to start building Facebook Apps with RoR?

2011-06-22 Thread Pravin Mishra
Hi everyone, what are your best references (tutorials & howtos) for an experienced Rails Developer to start building Facebook Apps with RoR? THANKS +++ Pravin Mishra -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this

Re: [Rails] Re: How much logic should I add to my ActiveRecords

2011-06-22 Thread Chirag Singhal
It may sound silly simple, but why not just defined a named scope for that and be done with it. Assuming you are on Rails 3 something like this should work: scope :active, lambda {where(["created_at > ?", 10.days.ago])} -- You received this message because you are subscribed to the Google Group

Re: [Rails] Re: How much logic should I add to my ActiveRecords

2011-06-22 Thread Colin Law
On 22 June 2011 06:36, John SB wrote: > Thanks for that, I simplified things a bit for the post.  There is > actually a reason to have an explicit status. > > I'm going ahead with adding the after_find callback but I think I've > run into another issue. > > I was thinking I would do the following