Re: [Rails] Unable to connect my ruby ​​on rails APP to a SVN repository

2019-07-03 Thread Harold Alcalde Solarte
Juodziukynas escribió: > > Have you tried the --verbose option when you run the command? it should > give you some information of all the steps that the command executes. > > El vie., 28 jun. 2019 a las 7:15, Harold Alcalde Solarte (< > haroldalca...@gmail.com >) escribió: >

Re: [Rails] Unable to connect my ruby ​​on rails APP to a SVN repository

2019-06-28 Thread Harold Alcalde Solarte
escribió: > > You have no blank space between USER and "--password". Also add the option > "--verbose" to the comend to see more info of the request. Are you sure the > command works? I mean, I don't see how it's related to ruby nor rubyonrails. > > El jue., 27

[Rails] Unable to connect my ruby ​​on rails APP to a SVN repository

2019-06-27 Thread Harold Alcalde Solarte
Hi all, I am trying to create in my APP a tree of directories from the data of the SVN repository. My app is on Windows and the repository I'm trying to access on another Linux server. I'm using the command to get all the files and folders: 'svn list -R http://172.xx.xx.xx/repos/Ttest/

[Rails] Re: My program does not work after adding helpler

2015-11-02 Thread James Harold
On Sunday, November 1, 2015 at 8:15:53 PM UTC-6, James Harold wrote: > > I have just gotten to Chapter Four of Michael Hartl's Ruby on Rails > Tutorial, and I can't seem to get the program to work after adding a helper > to the program. Here is the code fr

Re: [Rails] Re: My program does not work after adding helpler

2015-11-02 Thread James Harold
On Monday, November 2, 2015 at 10:18:01 AM UTC-6, Colin Law wrote: > > On 2 November 2015 at 16:01, James Harold <jharo...@gmail.com > > wrote: > > > > BTW, the error is listed here: > > > > 1) Failure: > > StaticPagesControllerTest#test_shoul

Re: [Rails] Re: My program does not work after adding helpler

2015-11-02 Thread James Harold
On Monday, November 2, 2015 at 10:33:32 AM UTC-6, James Harold wrote: > > > > On Monday, November 2, 2015 at 10:18:01 AM UTC-6, Colin Law wrote: >> >> On 2 November 2015 at 16:01, James Harold <jharo...@gmail.com> wrote: >> > >> > BTW,

[Rails] My program does not work after adding helpler

2015-11-01 Thread James Harold
I have just gotten to Chapter Four of Michael Hartl's Ruby on Rails Tutorial, and I can't seem to get the program to work after adding a helper to the program. Here is the code from the files. static_pages_controller_test.rb require 'test_helper' class StaticPagesControllerTest <

[Rails] Re: Puts just work on Controllers

2009-08-20 Thread John-Paul Harold
Damaris Fuentes wrote: Taking a look through Google I found that some people have the same problem, but most of them because they have changed from Webrick to Mongrel. Apparently, console with mongrel does not show the puts messages. However, I am working with webrick. I'm getting the

[Rails] Re: rails.vim - killing the server?

2009-05-03 Thread Harold
, and you should be able to start the server again on the same port: $ ps auxwww |grep ruby $ script/server [...] Hope that helps, -Harold On May 3, 7:48 am, 7stud -- rails-mailing-l...@andreas-s.net wrote: In macvim, I started the server like this: :Rserver But I'm trying to debug something

[Rails] Re: rails.vim - killing the server?

2009-05-03 Thread Harold
-l...@andreas-s.net wrote: Harold wrote: I don't have a mac, but this is pure unix and should be applicable to you as well. Get the PID of the server process and kill it manually: $ ps aux |grep ruby hgimenez 30736 24.8  1.6  48772 33252 pts/0    Sl+  11:22   0:03 ruby script/server

[Rails] Re: MacVim and rails.vim not working

2009-04-30 Thread Harold
Should be simple: The rails folder should not be present under your .vim folder. Move the plugin, doc and autoload files individually to each of the subfolders of .vim, so that the tree looks like this: .vim | --autoload | | | --rails.vim --doc | | | --rails.txt --plugin |

[Rails] Re: how to search all fields for a string in SQL ?

2009-04-30 Thread Harold
I would suggest going with the thinkingsphinx plugin instead of ultrasphinx. Thinkingsphinx's syntax is much cleaner. http://ts.freelancing-gods.com/usage.html http://railscasts.com/episodes/120-thinking-sphinx On the other hand, if your dataset is small enough, you could try scoped-search,

[Rails] Re: Integrate test process with Rspec and Cucumber in a plugin using Desert

2009-04-30 Thread Harold
Are you require'ing all of the files it can't find inside spec_helper? I've never done anything with Desert, but sounds like the files aren't being required. Some code would help diagnose the issue. On Apr 30, 11:12 am, romain endelin kilik.kil...@gmail.com wrote: Hello, I'm developing some

[Rails] Re: MacVim and rails.vim not working

2009-04-30 Thread Harold A . Giménez Ch .
On Thu, Apr 30, 2009 at 6:10 PM, 7stud -- rails-mailing-l...@andreas-s.netwrote: Harold wrote: Should be simple: The rails folder should not be present under your .vim folder. Stupid maintainer. Excuse me? Move the plugin, doc and autoload files individually to each

[Rails] Re: MacVim and rails.vim not working

2009-04-30 Thread Harold A . Giménez Ch .
It is misleading, I'll give you that...but for future reference, the process you just went through will be very similar with any vim plugin. On Thu, Apr 30, 2009 at 6:34 PM, 7stud -- rails-mailing-l...@andreas-s.netwrote: 7stud -- wrote: Harold wrote: Should be simple: The rails folder

[Rails] Re: Rspec

2009-04-22 Thread Harold
The rspec site has good documentation: http://rspec.info/documentation/ But I would suggest you read other people's code and buy the rspec book (currently in beta). If you had any specific issue we might be able to help. On Apr 22, 6:06 am, Shakthi Murugan rails-mailing-l...@andreas-s.net

[Rails] Re: Problems with Rails and Postgres

2009-04-20 Thread Harold
What kind of error do you get, exactly? On Apr 16, 1:10 pm, Rafael Roque rails-mailing-l...@andreas-s.net wrote: Hi all, i have a method that I use in the 'after_save' that is implemented as follows:  def verify     a =11674     x =  self.aui_codigo       reinc

[Rails] Re: Testing and SQL views.

2009-04-17 Thread Harold A . Giménez Ch .
What DBMS are you using? The alternative is a materialized view. On Fri, Apr 17, 2009 at 8:42 AM, Tim Uckun timuc...@gmail.com wrote: Name the fixtures.yml file after the actual target table, not the view. I'll give that a shot. Thanks...

[Rails] Re: Testing and SQL views.

2009-04-17 Thread Harold A . Giménez Ch .
, they are just tables, or even better, a thing where active record persists data... On Fri, Apr 17, 2009 at 8:57 AM, Tim Uckun timuc...@gmail.com wrote: On Sat, Apr 18, 2009 at 12:43 AM, Harold A. Giménez Ch. harold.gime...@gmail.com wrote: What DBMS are you using? The alternative

[Rails] Re: New to Ruby on Rails

2009-04-16 Thread Harold
not being defined or found, but your logs should tell you exactly what's going on. Hope that helps, -Harold On Apr 16, 5:16 am, saravanan@gmail.com saravanan@gmail.com wrote: Hi I have installed ruby186-26 using this linkhttp://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=1

[Rails] Re: query pulling too many fields

2009-04-16 Thread Harold
The find's :select option is ignored when you combine it with the :include option. On Apr 16, 8:58 pm, Scott Kulik rails-mailing-l...@andreas-s.net wrote: i'm a little confused here on what's happening. i have two tables ITEMS and ITEM_TYPES ITEMS (belongs_to :item_type) id name

[Rails] Re: SQL Server via DBI/ODBC configuration

2009-04-15 Thread Harold
-v datasource username password Hope that helps, -Harold On Apr 14, 7:21 pm, mvargo mfva...@gmail.com wrote: Dear Chris, Thank you for reponding.  I tried that.  I get the same error from a different stack.  It finds the new sqlserver.rb from the gem you suggested.  But it still barfs

[Rails] Re: Ridiculously Slow View Rendering

2009-04-06 Thread Harold
I can't find anything fundamentally wrong on your views, but we haven't seen any controller and model code. Try benchmarking/profiling your app to find out exactly what the bottleneck is. See http://guides.rubyonrails.org/performance_testing.html A good start may be your DB. What RDMS are you

[Rails] Re: Ridiculously Slow View Rendering

2009-04-06 Thread Harold A . Giménez Ch .
, not the actual files in the DB. Could it still be a bandwidth still be an issue DB = webserver if they're on the same box? Controller code is at the end here:http://gist.github.com/90786 Cheers, Avishai On Apr 6, 12:50 pm, Harold harold.gime...@gmail.com wrote: I can't find

[Rails] Re: Ridiculously Slow View Rendering

2009-04-06 Thread Harold A . Giménez Ch .
. -Avishai On Apr 6, 2:13 pm, Harold A. Giménez Ch. harold.gime...@gmail.com wrote: This is good to know. Completed in 319ms (View: 288, DB: 27) 319ms is not hardly close to your original 11386ms. I notice that your params below do not have any of the search criteria

[Rails] Re: Rails VS. .Net MVC

2009-04-03 Thread Harold
To me it's mostly about the Open Source culture: Not only Rails, but the entire stack as many have pointed out. Open source is not only about free (as in beer), but the freedom to do whatever the heck you want with it - for instance, deploy on nginx with mongrel, or thin, or passenger, under any

[Rails] Re: OOP road block

2009-04-01 Thread Harold
I think this is a common 'dilemma' that comes across every now and then. Which model should I ask for this information? I also think there's no right answer. But here's my two cents: In your case, you want to know which a product was purchased by a user, so the question could go both ways: Did a

[Rails] Re: rearranging the letters of a word

2009-04-01 Thread Harold
# Based on: # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/139290 # Author: Endy Tjahjono class String def perm return [self] if self.length 2 ret = [] 0.upto(self.length - 1) do |n| #rest = self.split('') rest = self.split(//u)

[Rails] Re: Nil being coerced to float

2009-04-01 Thread Harold
All you need to do to your original code is add a condition to make sure @payments is not null: @payment_total = @payments.sum{ |payment| payment.value } unless @payments.nil? Or can payment.value be nil for some payments but not others? Inject could help in that case: @payment_totals =

[Rails] Re: Use fixtures within fixtures?

2009-03-29 Thread Harold A . Giménez Ch .
The finder call to the DB is redundant. How about you save yourself the trip to the db and just do one-en: id: %= Fixtures.identify(:one) -% locale: en name: cars On Sun, Mar 29, 2009 at 9:15 AM, Heinz Strunk rails-mailing-l...@andreas-s.net wrote: Oh, I thought I could call that

[Rails] Re: Use fixtures within fixtures?

2009-03-28 Thread Harold
How about using erb? %= find_by_id(some-id) % On Mar 28, 1:41 pm, Heinz Strunk rails-mailing-l...@andreas-s.net wrote: Heya, I'm using globalize2 and have following problem with my fixtures: categories.yml: one:   parent_id: two   color: #ff00aa two:   color: #00ff11 three:  

[Rails] Re: Use fixtures within fixtures?

2009-03-28 Thread Harold
I don't get that...it doesn't really look at any other yml, it just calculates a hash: Fixtures.identify(:one) = 953125641 Fixtures.identify(:two) = 996332877 How are you calling this? -H On Mar 28, 2:34 pm, Heinz Strunk rails-mailing-l...@andreas-s.net wrote: Um well... I use two

[Rails] Re: Adding a css stylesheet to a plugin

2009-03-27 Thread Harold
I don't think it is a good idea to try to 'auto-load' a css. The css is used in a layout, but it's up to the user to specify which layout or layouts she wants to use your plugin in. Also, your css rules may colide with someone else's code and if you auto-load it, it would be very hard to catch

[Rails] Re: Hash with key and value from ActiveRecord?

2009-03-25 Thread Harold
Try this: @attributes = Hash[*Attribute.find_all_by_character_id(@character).map { |a| [a.name, a.value] }.flatten] On Mar 25, 7:46 am, Heinz Strunk rails-mailing-l...@andreas-s.net wrote: Heya, I think I have thinking barrier. I just want a simple hash out of an ActiveRecord. @attributes

[Rails] Re: Hash with key and value from ActiveRecord?

2009-03-25 Thread Harold
I actually don't get the OP's use of the hash method in this context: http://www.ruby-doc.org/core/classes/Array.html#M002182 It seems that it's just computing the hash, and the block passed is just being silently ignored... Heniz, using your code what's the output of @attributes.inspect and

[Rails] Re: OCR project in Gsoc

2009-03-24 Thread Harold
There are many ways to accomplish this, none of them are easy... There's ai4r's backpropagation nueural nets implementation, with a simple OCR example at http://ai4r.rubyforge.org/neuralNetworks.html There's also gnu Ocrad, which I've never used: http://www.gnu.org/software/ocrad/, and just

[Rails] Re: Charts in Rails

2009-03-20 Thread Harold
There's plenty out there, Fusion charts free and open flash charts being my top choices. This InfoQ article includes Fusion Charts in their comparison: http://www.infoq.com/articles/sharma-charts-in-rails Open Flash Charts: http://teethgrinder.co.uk/open-flash-chart/

[Rails] Re: Charts in Rails

2009-03-20 Thread Harold A . Giménez Ch .
You must have glossed over the OP's requirements indeed I did. My apologies. On Fri, Mar 20, 2009 at 1:58 PM, Robert Walker rails-mailing-l...@andreas-s.net wrote: Harold wrote: There's plenty out there, Fusion charts free and open flash charts being my top choices. You must have

[Rails] Re: Date-conventions

2009-03-19 Thread Harold
I've always followed: *_on = some date *_at = some datetime I rarely ever use date only fields though. Sure you don't want to store the purchase date _and_ time? Up to you of course... On Mar 19, 5:11 am, Sebastian Joecks rails-mailing-l...@andreas- s.net wrote: hey all i got a (hopefully)

[Rails] Re: generate csv from ruby object

2009-03-19 Thread Harold
Ruports is pretty slick: http://rubyreports.org/ On Mar 19, 1:55 pm, Dhaval Phansalkar rails-mailing-l...@andreas- s.net wrote: hi all, is there any method/way to generate a csv from an object directly? e.g. @object.to_csv that will create a csv file with whatever data that object holds?

[Rails] Re: very simple authenticatation

2009-03-19 Thread Harold
The logic is wrong. Try this: def authenticateAdmin authenticate_or_request_with_http_basic do |name, password| credentials = {'admin' = 'admin', 'slt' = 'slt'} credentials[name] == pasword end end On your previous examples, your method was returning 'the last thing

[Rails] Re: Find all messages from all friends

2009-03-16 Thread Harold
Any comments on the performance from anyone? Don't worry about it until it's a problem. YAGNI. But then again, you can do caching, paginate, intelligently use ajax to load only what's needed, etc. --~--~-~--~~~---~--~~ You received this message because you are

[Rails] Re: do not understand collect method use wit property

2009-03-11 Thread Harold
They are both equivalent in terms of functionality. The first is a common rails idiom: @some_collection.collect(:id) or @some_collection.map(:id) #I've seen this one used more than collect... The ampersand syntax is simply telling the interpreter that the symbol is the block parameter to the

[Rails] Re: Rails cross platform problem

2009-03-10 Thread Harold
This is related to the fact that on *nix the default end of line character is \n, and on windows, it's \r\n (note that this is not Ruby specific, but platform specific - Ruby is just following along). There's a utility on unixes called unix2dos which you can use to substitute all \n characters

[Rails] Re: Protecting an associated record from destroying -- How To and explanation?

2009-03-09 Thread Harold A . Giménez Ch .
Another option is using the before_destroy callback to do the check: http://apidock.com/rails/ActiveRecord/Callbacks/before_destroy On Mon, Mar 9, 2009 at 9:27 AM, Ar Chron rails-mailing-l...@andreas-s.netwrote: vimal wrote: Then i removed the pattern which was used by a schedule. How can

[Rails] Re: No error but mail not sent?

2009-03-09 Thread Harold
Get Rails out of the equation. Can you have your local smtp server send out emails directly, without using Rails? On Mar 9, 4:50 pm, Guillaume Loader rails-mailing-l...@andreas-s.net wrote: No I'm in local so I use localhost. Am I wrong? -- Posted viahttp://www.ruby-forum.com/.

[Rails] Re: Application access for non-Rails developers

2009-03-09 Thread Harold
Access to what? The source code? On Mar 9, 4:14 pm, Ian ian.2...@yahoo.com wrote: I was wondering if anyone gives non-developers access to their Rails applications (like say a tech-savvy content manager or designer) and if so, how?  What software? etc.

[Rails] Re: No error but mail not sent?

2009-03-09 Thread Harold A . Giménez Ch .
direction. Hope that helps, -Harold On Mon, Mar 9, 2009 at 5:13 PM, Guillaume Loader rails-mailing-l...@andreas-s.net wrote: I don't know? How can I try? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you

[Rails] Re: Newb question...get info from the db

2009-03-09 Thread Harold
In that case, try: class MemberController ApplicationController def index @user= User.find_by_login(params[:l]) flash[:notice] = @user.login + , you've logged in successfully end end On Mar 9, 7:24 pm, Chris Gunnels rails-mailing-l...@andreas-s.net wrote: Rails' default is that

[Rails] Re: Newb question...get info from the db

2009-03-09 Thread Harold A . Giménez Ch .
was not defined on the user object. @user.login returns a string, which does have the + method and therefore you can concatenate with the rest of your string (in the flash message). On Mon, Mar 9, 2009 at 7:59 PM, Chris Gunnels rails-mailing-l...@andreas-s.net wrote: Harold wrote: In that case

[Rails] Re: Looking for a tool do visualize the data model of a rails application

2009-02-16 Thread Harold
I found that schemaSpy was really helpful in visualizing and sharing any database's ER diagram... http://schemaspy.sourceforge.net/ On Feb 16, 7:41 am, ms m...@tzi.de wrote: Hey, I'm looking for a tool which allows me to visualize the data model of a rails application in uml diagrams. In

[Rails] Re: How can I get the current url i'm looking at?

2009-02-16 Thread Harold
You can always look at your browser's address bar or bookmark it. Or, within the context of Rails, http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html#M000469 On Feb 16, 2:38 pm, John Smith rails-mailing-l...@andreas-s.net wrote: How can I get the current url i'm looking

[Rails] Re: Two-to-one mappings

2009-02-15 Thread Harold
:49 am, Harold A. Giménez Ch. harold.gime...@gmail.com wrote: Great! Glad it worked. On Sun, Feb 15, 2009 at 1:57 AM, Greg gregory.brock...@gmail.com wrote: Cool!  Harold, your solution strikes me as being exactly the way to do it.  I've implemented it, and things seem to be sailing

[Rails] Re: Two-to-one mappings

2009-02-15 Thread Harold A. Gimenez
Actually, by user I mean competitor, but you get the point... -Original Message- From: Harold harold.gime...@gmail.com Reply-to: rubyonrails-talk@googlegroups.com To: Ruby on Rails: Talk rubyonrails-talk@googlegroups.com Subject: [Rails] Re: Two-to-one mappings Date: Sun, 15 Feb 2009 14:55

[Rails] Re: Two-to-one mappings

2009-02-15 Thread Harold A . Giménez Ch .
15, 6:06 pm, Harold A. Gimenez harold.gime...@gmail.com wrote: Actually, by user I mean competitor, but you get the point... -Original Message- From: Harold harold.gime...@gmail.com Reply-to: rubyonrails-talk@googlegroups.com To: Ruby on Rails: Talk rubyonrails-talk

[Rails] Re: Schedule job in rails

2009-02-14 Thread Harold A . Giménez Ch .
No quite like that. If you're sending an HTTP GET request to any URL, you would pass parameters to the URL itself, something like: http://localhost:3000/cron?param1=value1param2=value2 etc What looks attractive to me about this approach (of using wget via cron instead of a rake task) is that you

[Rails] Re: Two-to-one mappings

2009-02-14 Thread Harold
That's a clean solution, however I don't know if it satisfies the fact that any Room might have many different combinations of Rounds Not sure I understand correctly, but if a room can have many combination of rounds, and each combination of rounds has more than one round, you could try this:

[Rails] Re: Two-to-one mappings

2009-02-14 Thread Harold A . Giménez Ch .
Great! Glad it worked. On Sun, Feb 15, 2009 at 1:57 AM, Greg gregory.brock...@gmail.com wrote: Cool! Harold, your solution strikes me as being exactly the way to do it. I've implemented it, and things seem to be sailing smoothly. Thanks a lot to both of you. Sincerely, Greg On Feb 14

[Rails] Re: Schedule job in rails

2009-02-13 Thread Harold A. Gimenez
That's a great idea, until someone in the outside finds out about that path/resource. You're opening up too much and scriptkiddies can get happy attempting a DoS. Wondering if you handle that somehow (IP address check or something)? -Original Message- From: Mario Gutierrez

[Rails] Re: Schedule job in rails

2009-02-12 Thread Harold
Especially if this method is accessing your models, I don't see a way around loading your entire rails environment. I think a more common solution would be to create a rake task which you invoke with cron... On Feb 12, 10:53 pm, Valentino Lun rails-mailing-l...@andreas-s.net wrote: Dear all

[Rails] Re: Best Way to detect if you are in a migration?

2009-02-09 Thread Harold
I recently posted a similar question. No answer... http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/5d38a62129fa63e4/a78671aa145bf278?hl=en#a78671aa145bf278 On Feb 9, 3:11 pm, Frantisek Psotka rails-mailing-l...@andreas-s.net wrote: I im interested in this question, has

[Rails] detecting rake db:migrate ?

2009-02-05 Thread Harold
Hi group, I have a line of code in environment.rb that cannot be run during a rake db:migrate, as it depends on some tables being present. I need to find a way to enclose this line in a check for db:migrate. I know how to check if we're in a rake task with: unless defined?(Rake) # do stuff,

[Rails] Re: detecting rake db:migrate ?

2009-02-05 Thread Harold
Excuse me, the code I need to wrap around the check is on ApplicationController. Still, any ideas? On Feb 5, 3:33 pm, Harold harold.gime...@gmail.com wrote: Hi group, I have a line of code in environment.rb that cannot be run during a rake db:migrate, as it depends on some tables being

[Rails] Re: detecting rake db:migrate ?

2009-02-05 Thread Harold A . Giménez Ch .
the code if it does On 06/02/2009, at 6:51, Harold harold.gime...@gmail.com wrote: Excuse me, the code I need to wrap around the check is on ApplicationController. Still, any ideas? On Feb 5, 3:33 pm, Harold harold.gime...@gmail.com wrote: Hi group, I have a line of code

[Rails] Re: get # of errors in error_messages_for

2009-02-05 Thread Harold
Haven't tried this, but how about #{User.errors.size} errors, please ... On Feb 5, 10:33 pm, Johnroy World rails-mailing-l...@andreas-s.net wrote: i need a solution my friend. any help or advice would be appreciated. Thank you -- Posted viahttp://www.ruby-forum.com/.

[Rails] Re: We don't need no stinking Badges! Guidance, anyone?

2009-02-04 Thread Harold
Why do you even need a UserBadge model? I would have User model, a Badge model, where the relationship is User belongs_to :badge, and badge has_many :users. Then you can simply assign it with some_user.badge = some_badge. It seems like you're adding complexity with the UserBadge model and the

[Rails] Re: ActiveRecord can validates select querys?

2009-02-02 Thread Harold
Can you give an example of what you mean by validate the data before passing it over to SQL? If it's SQL injection you're worried about, rails can help clean up user input, but I'm not sure that's where your heading with this... On Feb 2, 11:18 am, Daniel López

[Rails] Re: ActiveRecord can validates select querys?

2009-02-02 Thread Harold A . Giménez Ch .
a regex), or there's a plugin that helps for this (i haven't tried it: http://railslodge.com/plugins/111-validates-date-time) etc... is that what you're looking for? On Mon, Feb 2, 2009 at 12:10 PM, Daniel López rails-mailing-l...@andreas-s.net wrote: Harold wrote: Can you give an example

[Rails] Re: ActiveRecord can validates select querys?

2009-02-02 Thread Harold A . Giménez Ch .
, Feb 2, 2009 at 12:30 PM, Daniel López rails-mailing-l...@andreas-s.net wrote: Harold A. Giménez Ch. wrote: Sounds like something you can do with ActiveRecord validations: http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html for example

[Rails] Re: ActiveRecord can validates select querys?

2009-02-02 Thread Harold A . Giménez Ch .
, Harold A. Giménez Ch. harold.gime...@gmail.com wrote: In that case, I don't know of a way to reuse an ActiveRecord validation before running a find. You don't even have a ActiveRecord object at that point yet. You might just have to write your custom validations before running the find

[Rails] Re: Merging array with same key - HELP

2009-01-27 Thread Harold
Hi, hash = {} array1.uniq.each { |d| hash[d] = [] } array1.each_with_index { |x,i| hash[x] array2[i] } hash.each_key { |key| hash[key] = hash[key].join('-') } hash.inspect # = {01/01/2009=1stjan1-1stjan2-1stjan3, 10/01/2009=10thjan1-10thjan2} Enjoy, -Harold On Jan 27, 2:13 am, Shankar Ganesh

[Rails] Re: Ruby on Rails Dates

2009-01-14 Thread Harold
Can't you just send out an email, with [JOBS] in the subject? I don't think anyone would be bothered by that. Don't change a discussion subjects just for spite. Have some class. On Jan 14, 11:13 am, Michael Michael rails-mailing-l...@andreas- s.net wrote: I don't mean to be too intrusive as I

[Rails] Re: named_scope on has_many, find all records that don't have elements in that association

2009-01-11 Thread Harold
Thinking in SQL, you want to do this: select * from customers left outer join addresses on customers.address_id = addresses.id where addresses.id is null. First thing that comes to mind here something like: Customer.find(:all, :include = :address, :conditions = 'addresses.id is null') hope

[Rails] Re: Additional config file like database.yml

2009-01-09 Thread Harold
You can do solr_conf = open('path/to/solr.yml', 'r') { |f| YAML.load(f) } solr_conf now holds a hash with your parameteres. You can access it simply by doing something like: url = solr_conf[RAILS_ENV][:url] On Jan 9, 11:33 am, scott scot...@gmail.com wrote: you could code it yourself, i

[Rails] Re: How to pass parameters to a script in lib from terminal

2009-01-09 Thread Harold
I don't think you can do it using script/runner (I may be wrong). You could run the script directly using ruby lib/joe_converter.rb, and handle the parameters in your script. Your rails app wouldn't load in this case. Another (probably preferred) option is to create a rake task in lib/tasks that

[Rails] Re: How to pass parameters to a script in lib from termina

2009-01-09 Thread Harold A. Giménez Ch.
Well, you have to play nice with the rules of the command line (like no spaces etc). Also note that whatever comes into your rake task is simply a string. You would have to parse that string and build any object you need, such as a hash or array... Any code on how you're handling the params? On

[Rails] Re: Trying to sort results of one-to-many relationship find

2009-01-08 Thread Harold
This is a plain association, no join table involved. Try this in script/console and see if it solves your problem. The DB can easily take care of the sorting: orders = Order.find(:all, :conditions = '...', :include = :payee, :order = 'payees.last_name') Then, orders.each { |o| puts

[Rails] Re: 126: The specified module could not be found. - c:/ruby/lib/ruby/gems/1.8/gems/ruby-postgres-0.7.1.2006.04.06-x86-msw in32/postgres.so

2009-01-07 Thread Harold
Is the postgres bin directory in your PATH? Usually: C:\Program Files\PostgreSQL\8.3\bin On Jan 7, 4:07 pm, Ruby Newbie irs...@gmail.com wrote: I have install postgres but I am getting this message when I am starting the application. Please help

[Rails] Re: Cloning ActiveRecord objects

2009-01-06 Thread Harold
Try your_active_record_instance.dup instead of .clone. On Jan 6, 6:43 am, Rob Lacey r...@mail.pigdestroyer.co.uk wrote: Hi there, I've been working on a solution to try and fix a problem I am getting with the Interlock plugin. However, my quick solution was to clone my ActiveRecord object

[Rails] Re: items.destroy doesn't work

2009-01-06 Thread Harold
How about Item.destroy_all(conditions) Which will call the destroy callback methods (slow if you are destroying many records). If you don't care about callbacks, use delete_all instead. http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001974 On Jan 6, 3:22 pm, scott

[Rails] Re: AR deep clone

2009-01-06 Thread Harold
Ran into this a while back. your_ar_instance.dup will keep the child records as well. On Jan 6, 1:25 pm, Michael Rigart rails-mailing-l...@andreas-s.net wrote: Hi all, I'm having problems with cloning an ActiveRecord Object. The object consists of multiple child objects, so when I use the

[Rails] how to monkeypatch Hash's []= method

2009-01-06 Thread Harold
I'm trying to monkeypatch the []= method in the Hash class: Hash.class_eval do def []_with_feature=(a,b) puts 'foo' end alias_method_chain :[]=, :feature end Something is wrong with the syntax, but I can't figure out what. The alias_method_chain method does look for punctuation (= in

[Rails] Re: how to monkeypatch Hash's []= method

2009-01-06 Thread Harold A. Giménez Ch.
: On 6 Jan 2009, at 23:36, Harold wrote: I'm trying to monkeypatch the []= method in the Hash class: doesn't seem to be anything to do with alias_method_chain - just sticking def []_with_feature=(a,b) puts 'foo' end into irb causes similar errors. You'll just have to skip alias method

[Rails] Re: how to monkeypatch Hash's []= method

2009-01-06 Thread Harold A. Giménez Ch.
I was focusing on the = being the problem... Worked nicely. Many thanks! On Tue, Jan 6, 2009 at 7:20 PM, Frederick Cheung frederick.che...@gmail.com wrote: On 6 Jan 2009, at 23:56, Harold A. Giménez Ch. wrote: Thanks for the response. So how in the world is this implemented

[Rails] Re: Help creating and using database

2008-12-22 Thread Harold
I think what you're looking for is the build method, something along the lines of @job.steps.build in your controller. Take a look at the complex form railscasts by Ryan Bates: http://railscasts.com/episodes/73-complex-forms-part-1 (go to parts 2 and 3 after you're done with part 1). On Dec

[Rails] Re: RoR IDE

2008-12-20 Thread Harold
I second vim with rails.vim, and a few other plugins: matchit camelcasemotion fuzzyfinder and fuzzyfind_textmate snippetsEmu vcscommand and either vividchalk or railscasts as a colorscheme. Vim is definitely worth the learning curve, but you need to invest some time before you realize how

[Rails] Re: SuperInPlaceControl

2008-12-06 Thread Harold A. Giménez Ch.
PROTECTED] wrote: On Fri, Dec 5, 2008 at 12:51 PM, Harold [EMAIL PROTECTED] wrote: The fact that I get no response tells me that nobody is using SuperInPlaceControls. What's out there for in place select editing on Rails 2.1? Any pointers or comments welcome. I think if you had

[Rails] Re: SuperInPlaceControl

2008-12-05 Thread Harold
Bump... The fact that I get no response tells me that nobody is using SuperInPlaceControls. What's out there for in place select editing on Rails 2.1? Any pointers or comments welcome. Thanks. On Dec 5, 12:50 am, Harold [EMAIL PROTECTED] wrote: In Rails 2.1, I am using

[Rails] SuperInPlaceControl

2008-12-04 Thread Harold
In Rails 2.1, I am using the SuperInPlaceControl plugin to render an in_place_select on an instance of a model with a has_many relationship. So far so good, except that when I click on OK to save the user's selection, the ajax call is posted, the record is updated, but the label on the view never

[Rails] Re: Iterate through a table record

2008-11-21 Thread Harold
A legs table seems more flexible, however: tr % (1..36).each do |p| % tdLeg %= @race.send(('leg' + p).to_sym) %/td % end % /tr On Nov 21, 5:59 pm, Bill McGuire [EMAIL PROTECTED] wrote: Lennart Koopmann wrote: 2008/11/21 Bill Mcguire [EMAIL PROTECTED] Is there a way to increment

[Rails] Re: Where should data migrations go?

2008-11-14 Thread Harold
I do data only migrations all the time, especially for reference values and such. What kind of problems do you encounter? The one caveat could be that you may have to define the model classes involved inside your migration. For example: class Software ActiveRecord::Base; end and in your

[Rails] Re: database documentation

2008-11-07 Thread Harold
Along the same lines as Fred suggests, it should be on the model. We've been using the annotate_models to do it for us. http://agilewebdevelopment.com/plugins/annotate_models -H On Nov 7, 5:17 am, Frederick Cheung [EMAIL PROTECTED] wrote: On 7 Nov 2008, at 01:30, Norm wrote: Fernando

[Rails] Re: 2 apps with 1 one database.

2008-10-31 Thread Harold
Well, to me it sounds like your admin app is just a bunch of rake tasks that do some bookkeeping for you. You seem to be solving a problem that does not exist - again, what's the problem with the admin code living in the same app? Even if it makes it to production? Be that as it may, if you

[Rails] Re: 2 apps with 1 one database.

2008-10-30 Thread Harold
On the other hand, I don't understand why not use role based authorization to the admin area? On Oct 30, 4:54 pm, jef [EMAIL PROTECTED] wrote: Interesting.  What leads you to want to separate the admin functionality into a completely separate app? I  want my dev app to be equal to the