[Rails] rails 3 meta_search usage

2010-11-29 Thread tispratik
I am in the process of upgrading my app from Rails2 to Rails3. My Rails2 app uses searchlogic heavily. After googling i've come to know that searchlogic is not compatible with Rails3 and need to use meta_search instead. But i havent quite understood the usage of meta_search vis-a-vis searchlogic.

[Rails] Re: REE and ruby PATH problem

2010-06-07 Thread tispratik
ubuntu > whereis gem gem: /usr/bin/gem1.8 /usr/bin/gem /opt/ruby-enterprise-1.8.7-2010.01/ bin/gem As Ivan suggested, i think its a rubygems problem. I havent installed rubygems in the REE. Currently it is installed only in normal ruby. I will install rubygems in REE and uninstall from normal ruby

[Rails] Re: REE and ruby PATH problem

2010-06-07 Thread tispratik
Also notice that the gem environment does not reflect the REE version of Ruby, RUBY VERSION: 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux] -- 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 rubyonrail

[Rails] Re: REE and ruby PATH problem

2010-06-06 Thread tispratik
r/bin/gem > sudo ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/rake /usr/bin/rake > > Ivan Nastyukhin > dieinz...@me.com > > On Jun 7, 2010, at 10:19 AM, tispratik wrote: > > > > > I have ruby normal edition installed in /usr/bin > > REE in /opt/ruby-enterprise

[Rails] Re: REE and ruby PATH problem

2010-06-06 Thread tispratik
more information: ubuntu > gem environment RubyGems Environment: - RUBYGEMS VERSION: 1.3.5 - RUBY VERSION: 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux] - INSTALLATION DIRECTORY: /opt/ruby-enterprise-1.8.7-2010.01/lib/ ruby/gems/1.8 - RUBY EXECUTABLE: /opt/ruby-enterprise-1.8.7-2010.01/

[Rails] REE and ruby PATH problem

2010-06-06 Thread tispratik
I have ruby normal edition installed in /usr/bin REE in /opt/ruby-enterprise-1.8.7-2010.01/bin I have all my application gems installed in /opt/ruby- enterprise-1.8.7-2010.01/bin but still when i run any gem related command, say "sudo bluepill status", it looks for the executable in normal ruby edi

[Rails] Re: REE & application frozen gems

2010-06-06 Thread tispratik
Oh ok! I get it now, actually was confused by this post http://blog.perplexedlabs.com/2009/01/13/installing-ruby-enterprise-edition-with-phusion-passenger/ where it says that you need to reinstall all gems and had will_paginate in the list. I dont think will_paginate requires any native extensions.

[Rails] Re: REE & application frozen gems

2010-06-05 Thread tispratik
but the gems installed in the vendor directory are from my development environment. In my dev env, i dont have REE installed, so those gems were installed and frozen using the dev ruby compiler. Shouldn't i install the gems using REE and then freeze them in prod env? -- You received this message

[Rails] REE & application frozen gems

2010-06-04 Thread tispratik
I have the following versions of ruby installed in my production env. ubuntu ~ > /usr/bin/ruby -v ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] ubuntu ~ > /opt/ruby-enterprise-1.8.7-2010.01/bin/ruby -v ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby Enterprise

[Rails] Re: Connecting multiple databases - has_many fails

2010-04-13 Thread tispratik
Thanks for the quick reply Philip. Unfortunately i am working on a windows machine and i am not aware of any tool which shows the query being run. An interesting workaround i found is by explicitly stating the database.table_name in the intermediate model. class ProjectRole < ActiveRecord::Base

[Rails] Connecting multiple databases - has_many fails

2010-04-13 Thread tispratik
Has anyone faced this problem before? I have 3 models, Project, ProjectRole and User. The tables are distributed in two databases. Databases: --

[Rails] Re: Attack on Twitter

2010-03-24 Thread tispratik
Thanks for the Information John. How do the zombies register for twitter? Can we not prevent them using captchas? Can the zombies get passwords of existing users? Can anyone attack Twitter by logging into one's own account? -Pratik -- You received this message because you are subscribed to the

[Rails] Attack on Twitter

2010-03-24 Thread tispratik
Hello, Does anyone know the reason for the vulnerability in Twitter when a lot of DOS attacks were made? Were they due to the design of the application or the server where they hosted got attacked? Thanks, Pratik -- You received this message because you are subscribed to the Google Groups "Ruby

[Rails] has_many_polymorphs with searchlogic

2010-03-23 Thread tispratik
Has anyone been able to use searchlogic with has_many_polymorphs? Are they compatible? -- 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,

[Rails] Connecting to sessions table in another database

2010-03-06 Thread tispratik
I have two applications, appA and appB. I want to use single sign on for both the apps. Meaning, if a user logs in to appA, he dont have to login to appB and conversely, if a user logged out of appA, it logs him out of appB too. Just like in google's various products. I created the sessions table

[Rails] Re: Use "establish_connection"

2010-03-03 Thread tispratik
How do we open a read-only connection to the second database development2 ? -- 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

[Rails] Loading Model in Yaml

2010-01-17 Thread tispratik
Am loading the model called "Decode" in my yaml file. When i run the rake db:seed, it runs fine in windows. But dont know why it fails in unix. Any ideas? params.yml <% require 'Decode' i = 0 %> Filter_Param<%= i=i+1 %>: id: <%= i=i+1 %> filter_param: chapter_status disp_value: Active inte

[Rails] Re: WiceGrid Plugin version 0.5

2010-01-10 Thread tispratik
Thanks Yuri, keep up the great work. This is exactly what was missing from rails :) -Pratik -- 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 g

[Rails] Re: Passwords

2009-12-18 Thread tispratik
Thanks for the inputs Norm and Denix. -- 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...@goog

[Rails] Passwords

2009-12-17 Thread tispratik
Hi, Does anyone know how to store passwords securely? I mean, we enter DB usr/pwd in the database.yml and the actionmailer email usr/pwds in environment.rb which i think is not safe, considering while development the code is visible to all developers. Do we have some mechanism to store all passwo

[Rails] Re: Account name added to URL

2009-12-09 Thread tispratik
Hi Samuel, Thanks for the reply. I have never used permalinks, can you point me to some tutorial for using it? -Pratik -- 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.c

[Rails] Account name added to URL

2009-12-08 Thread tispratik
Hi, How do we add default path to each route according to the account? ex:) My Webapp resides at www.example.com If I have 1 account named rorTalk and another named rubyTalk then both accounts should get their own sub url. eg) www.example.com/rorTalk/ www.example.com/railsTalk/ Then anything in

[Rails] Re: button_to

2009-09-13 Thread tispratik
http://localhost:3000/ users/1';" VALUE="Home"> Did the trick! --~--~-~--~~~---~--~~ 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 un

[Rails] button_to

2009-09-13 Thread tispratik
How can i specify the full url of the page i want to access using a button? ex: http://localhost:3000/users/1 I can use link_to as: link_to 'Home', "http://localhost:3000/ users/1" But i want to use a button in my form instead. Thanks, Pratik --~--~-~--~~~-

[Rails] Re: Unknown column 'id' in 'where clause': DELETE FROM `roles` WHERE `id` = NULL

2009-09-13 Thread tispratik
Then what is the workaround to this? I even tried this in Modul.rb before_destroy { |record| Role.destroy_all "modul_id = #{record.id}" } can i run a sql query of my own ? Thanks, Pratik --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[Rails] Re: Unknown column 'id' in 'where clause': DELETE FROM `roles` WHERE `id` = NULL

2009-09-12 Thread tispratik
Role Model: = create_table :roles, :id => false do |t| t.integer :user_id t.integer :modul_id t.string :role end Modul Model: == create_table :moduls do |t| t.string :name t.integer :updated_by t.timestamps end --~--~-~--~~-

[Rails] Unknown column 'id' in 'where clause': DELETE FROM `roles` WHERE `id` = NULL

2009-09-12 Thread tispratik
Hi, I have a Modul model and a Role model. Each modul can have many roles. So when the modul is deleted, it should delete the roles also. I have the following in my Modul model: has_many :roles, :dependent => :destroy When i run some_object.destroy from the console, i get the following error:

[Rails] Re: XSS security patch

2009-09-04 Thread tispratik
sorry the patch is at http://weblog.rubyonrails.org/assets/2009/9/4/2-3-CVE-2009-3009.patch --~--~-~--~~~---~--~~ 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 rubyonrail

[Rails] XSS security patch

2009-09-04 Thread tispratik
Hi, Does anyone know how to apply the XSS security patch delivered by the rails community at http://weblog.rubyonrails.org/assets/2009/9/4/2-3-timing-weakness.patch When i try to click on the link it opens some cryptic page. Thanks, Pratik --~--~-~--~~~---~--~~

[Rails] Re: pluralize method

2009-08-25 Thread tispratik
Oh! am sorry, its so insane of 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group,

[Rails] pluralize method

2009-08-24 Thread tispratik
Hi, The pluralize method does not seem to be working correctly. pluralize(count, "Due Today") gives me the following output: 2 Due Todays 1 Due Tomorrows 0 Past Dues 0 Due End of Weeks It should have been: 2 Due Today 1 Due Tomorrow 0 Past Due 0 Due End of Week Regards, Pratik --~--~-

[Rails] overriding .blank? method

2009-08-24 Thread tispratik
Hi, Does anyone know a way to override .blank? method that rails provides. I want to add additional custom checks (specific to my application) to this method. Thanks, Pratik --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

[Rails] Authlogic Forgot Password

2009-08-23 Thread tispratik
Hi, Has anyone implemented the Authlogic forgot password stuff? Please let us know how to, if anyone has or has the code for it. Thanks, Pratik --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" g

[Rails] Re: Calculate Last Day of Week

2009-08-23 Thread tispratik
Thank you very much Bala :) Regards, Pratik --~--~-~--~~~---~--~~ 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

[Rails] Calculate Last Day of Week

2009-08-22 Thread tispratik
Hi, Does anyone know how to calculate last day of week in Ruby? Date.today gives todays date Date.tomorrow gives tomorrow's date What abt end of week ? Thanks, Pratik --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Re: Array Manupulation

2009-08-22 Thread tispratik
Answer: === a[0] = a[0] + " AND " + b[0] b.length.times do |i| if i!=0 a << b[i] end end --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. T

[Rails] Array Manupulation

2009-08-22 Thread tispratik
Can anyone help me on the following? I have the following 2 arrays, how do i get c as a result of a and b. The elements should be in the specified order. a = ["(modulable_type=?) AND (parent_id=?) AND (status=?)","Task","2","20"] b = ["(tasks.due_date=?)", "2009-08-22"] c = ["(modulable_type=?)

[Rails] Caching Model Constants

2009-08-12 Thread tispratik
Hi, Does anyone know of a good way of caching the constant variables in the model. I have constants in models whose values are based on finder methods. eg) TYPE_UNIV = Decode.find_by_name("University") When i access this constant from Controllers or Views or Model, i see a query running in DB e

[Rails] Logging Plugin

2009-08-12 Thread tispratik
Hi, Does anyone know how to understand the logs printed in development.rb I can understand certain parts of it but not all. Is there any documentation on it? Or any pretty printing plugin available which tells exactly whats going on?... i mean how can i tell if certain objects are fetched from t

[Rails] AssociationTypeMismatch

2009-06-19 Thread tispratik
Am getting the following error: Modul(#36555780) expected, got String(#21132310) After doing a lot of research on the net, i found that i need to pass on the id field somehow, but i dont really know how to do it. Following is the model: - class Modul < ActiveRecor

[Rails] Re: ruby script/plugin install not working

2009-05-18 Thread tispratik
AM, tispratik wrote: > > > Windows OS. > > > Am running the following command to install authlogic. But the command > > is not working. Running the script creates an empty folder named > > authlogic inside /vendor/plugins directory but no files are copied > >

[Rails] Re: regarding info

2009-05-18 Thread tispratik
lynda.com has a good tutorial on RoR, its old but a good place to start with. Then you can continue with tutorialspoint.com -Pratik On May 18, 3:47 am, rgravina wrote: > On May 18, 4:02 am, César wrote: > > > From my point of view, you should know a little about Ruby code, is > > better to res

[Rails] ruby script/plugin install not working

2009-05-17 Thread tispratik
Windows OS. Am running the following command to install authlogic. But the command is not working. Running the script creates an empty folder named authlogic inside /vendor/plugins directory but no files are copied inside it. The script runs within a millisecond and returns without an error. rub