[Rails] Re: `rails g copy ModelName/ControllerName -> NewModelName/NewControllerName new_field_for_copied_model_controller_combination:string new_relation:references`

2019-09-20 Thread Josh Brody
I like this. Would dropping columns also be possible? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To v

[Rails] Major update to Rails Assets

2016-04-27 Thread Josh Jordan
r choosing a version other than the latest * Ability to link to component pages directly * Ability to link to search results directly As always, please hit us up with feedback! Josh PS: We're accepting donations at https://rails-assets.org now as well. If you find this useful, even a few

[Rails] Re: Jackbox Release Candidate 2

2015-11-19 Thread Josh Jordan
What happened to your contest? On Wednesday, November 18, 2015 at 1:57:18 PM UTC-5, lha wrote: > > Today we released Jackbox RC2. > > With this release we have concluded the upgrade of the inheritance model > and are gearing up for version 1.0. The inheritance model in Jackbox now > has to conc

[Rails] Where do I put plain old Ruby objects?

2015-11-05 Thread Josh Marchello
like this? Do I just stick it in the 'model' directory? or may 'lib'? Thanks, Josh -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email

[Rails] Using Angular with Rails

2015-10-24 Thread Josh Jordan
Absolutely not. You can adopt the pieces you like and use Angular patterns within isolated parts of your application. Here's a blog post I wrote on iterative adoption of AngularJS: http://tech.novus.com/multiple-single-page-apps-adopting-angularjs-in-an-existing-application/ -- You received th

[Rails] Re: Select_tag not saving associated child-object

2015-06-03 Thread Josh Sr.
Member of a FaceBook group helped me figure it out by adding a little extra logic in the controller save. if @campaign.save zip = Uploadzip.find(params[:uploadzip_id]) zip.campaign = @campaign zip.save flash[:success] = "Campaign Successfully Launched!"

[Rails] Select_tag not saving associated child-object

2015-06-03 Thread Josh Sr.
I have a form with a select_tag and options_from_collection_for_select that I can't seem to get to pass. The parent object, "Campaign", saves but does not associate with the child-object "Uploadzip". Campaign has_one Uploadzip Uploadzip belongs_to Campaign There's also the campaign_id foreign_key

[Rails] Re: Error when trying to create new app

2015-02-25 Thread Josh Latham
It said, "'$' is not recognized as an internal or external command, operable program or batch file." On Wednesday, February 25, 2015 at 5:53:59 PM UTC-6, Ruby-Forum.com User wrote: > > I don't have much experience in rails to tell you what to do, but open > your command promt and run this: > >

[Rails] Error when trying to create new app

2015-02-25 Thread Josh Latham
n spits out the following error message, "An error occurred while installing rake <10.4.2>, and Bundler cannot continue. Make sure that 'gem install rake -v '10.4.2' succeeds before bundling." What is this error message and what do I do? I'm using Windows

[Rails] Re: how to remove (and resuse) all existing constraints from ActiveRecord::Relation

2014-12-29 Thread Josh
> > Sounds like you are looking for >> > > some_scope.unscope(:where) > This doesn't appear to return the existing constraints for me to re-use them. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and

[Rails] how to remove (and resuse) all existing constraints from ActiveRecord::Relation

2014-12-28 Thread Josh
I'd like to remove all existing constraints from an ActiveRecord::Relation and leave the rest in-tact. I am *not* looking for #unscoped since I would like to keep any joins/order clauses around. Additionally, I would like to re-use the constraints that were removed in another query, so the a

Re: [Rails] Re: 10 tips to boost up performance of your Ruby on Rails application

2014-12-11 Thread Josh Jordan
While some of the advice here is good, it represents a very confused view of performance optimization. For instance, #2 is just plain bad advice for performance (but good for modularity) - partial rendering has a ton of overhead in Rails. #3 doesn't speak to performance at all. DRY (#4) is not

[Rails] Re: Implementing match-making with Ruby on Rails

2014-09-14 Thread Josh Jordan
I think this approach will be fine. The database is really good at getting you a single result quickly if that's all you ask for (e.g. PlayerQueue.where.not(player_id: current_player_id).order(:created_at).first). Some psuedocode: if the first player in the queue is still looking for a match

[Rails] Re: Relation count returns syntax error in Rails 4.1.X

2014-06-01 Thread Josh Jordan
Rails introduced a breaking change to select and count being used together in the same relation. Either remove your call to "select", since it is unnecessary here, or call "count(:all)". More info here: https://github.com/rails/rails/issues/15138 On Saturday, May 31, 2014 8:00:36 PM UTC-4, Ruby

[Rails] How to invoke cache sweeper from background jobs / models?

2014-05-25 Thread Josh Jordan
MVC doesn't mean that all your logic has to be in a model, view, or controller. It sounds like you just need a class to do your import work, such can be called from a controller, background job, script, migration, etc. -- You received this message because you are subscribed to the Google Group

Re: [Rails] Looking for some glue between Strong Parameters and CanCan

2014-03-26 Thread Josh Jordan
I can verify that cancancan does this, and it does it out of the box if you use the convention of naming your Strong Params method #{model_name.underscore}_params https://github.com/CanCanCommunity/cancancan On Wednesday, March 26, 2014 8:04:02 AM UTC-4, Walter Lee Davis wrote: > > > On Mar 25,

[Rails] AR: freezing PG Array

2014-03-14 Thread Josh Jordan
If that is true, the solution would be to properly mark the object as dirty when the array changes, not freeze the array. Why should this data type behave differently than all the others? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.

[Rails] Re: Rails 4 routing issue

2014-01-01 Thread Josh Jibwa White
I ran into some similar issues while upgrading some of my sites. My problems were mainly because I wasn't using standard resourceful routes. The simplest way to fix this is to just specify each route manually. If you have a lot of similar patterns with other resources you could just write a fun

[Rails] Re: rails engines and models

2014-01-01 Thread Josh Jibwa White
I think the best solution would be to create a engine or gem for the shared classes. Say you have a user model which has shared functions and application specific functions. I would put the base (shared) functionality into a base engine which is included in the feature engines. In each feature

[Rails] Re: why is my rspec controller test for get method not working?

2013-11-17 Thread Josh Jordan
I would have to contest that you didn't quite correct it then, eh? :p You wrote an expectation that says "I expect @account to be an array of accounts that contains a single, specific instance of Account." Why are you looking for an array? Your controller code looks right - it assigns @account

Re: [Rails] Can we keep validation in memcached ?

2013-11-03 Thread Josh Jordan
Why do you think memcached is only useful for storing response data? That is simply not true. Memcache has been around longer than Rails, and is useful as a general purpose, fast, volatile data store. You can use it for anything you like, and it applies well in any case where there is determini

Re: [Rails] how is mongoid syntax implemented ?

2013-10-24 Thread Josh Jordan
That is valid hash syntax. You're call a method with a signature like: def field(field_name, options = {}) ... end field_name is a symbol, options is a hash where the keys are symbols and the values are constants (class objects). On Wednesday, October 23, 2013 9:30:28 PM UTC-4, Dheeraj Kumar

[Rails] Re: Rails 4 deprecation of in-place edit methods for collection associations

2013-09-24 Thread Josh Jordan
The justification for this change seems preposterous. Why would anyone think that, in the former example, the database has changed? The method called there is named "select!". This sounds like a case of a few people writing fragile code without any understanding of what they were doing or the s

[Rails] Re: Accessing model attributes in ActiveSupport::Concern module

2013-09-20 Thread Josh Jordan
Felix, You defined image_dir as a local variable in the scope of the Job class. It goes out of scope (and, since nothing else references it, gets cleaned up) after the class definition of Job is evaluated. Instead, define image_dir on *instances* of Job: class Job < ActiveRecord::Base includ

Re: [Rails] Re: Having some issues on backend regarding a social networking project on ROR

2013-09-13 Thread Josh Jordan
Don't fool yourself into thinking that Facebook is using a single data store. Facebook has a massive set of resources Remember that they have their own PHP compiler. They are most certainly using multiple data stores redundantly and querying the right one for the job at hand for each particular

[Rails] Re: Combine two apps into one? Engines?

2013-07-19 Thread Josh Jordan
I think you're on the right track. It sounds like your views are not properly scoped to the engine, or you're trying to call routes from the engine that it doesn't know about. Can you try qualifying the routes with the application/engine they came from? See here: http://guides.rubyonrails.org/e

[Rails] can't convert Symbol into String

2013-07-07 Thread Josh Swasey
Hello, I'm following the tutorial at http://guides.rubyonrails.org/getting_started.html. I got to the point where adding new posts should be functional (the end of 5.7). When I try to submit a post, I receive the error stating "Can't convert Symbol into String". The trace shows: app/controlle

[Rails] Autload thread safety in Ruby 2.0?

2013-06-15 Thread Josh Jordan
Jose Valim implies that autoloading is threadsafe in Ruby 2.0: The issue with this approach is that it is not thread-safe, except for > latest JRuby versions (since 1.7) and Ruby master (2.0) http://blog.plataformatec.com.br/2012/08/eager-loading-for-greater-good > However, the autoload bug

[Rails] Re: Introducing MailJack: autogenerate querystring parameters that are appended to links in your emails

2013-06-08 Thread Josh Jordan
Hi Peter. Pretty cool. I think the biggest thing you can do to improve the code here would be to write some tests for it, so you can give your users confidence that it won't break with each subsequent release. It would also be beneficial to include the word "Rails" in the description so that pe

[Rails] Re: Need help even generating a new app

2013-01-16 Thread Josh Aronoff
Ok cool... Ugh, this permissions thing is driving me nuts. Can I just uninstall everything by deleting all the directories and re running the ruby and rails instals using either homebrow or rvm? to be clear, I'm only saying delete the ruby directory in my Library. -- Posted via http://www.ruby

[Rails] Re: Need help even generating a new app

2013-01-14 Thread Josh Aronoff
OK I went the Homebrew route, after some googling and tried to update my 1.8.7 Ruby to 1.9.3 like you mentioned and I'm STILL running into a permissions thing with my Library and that Gems directory. After running $ gem install rails bundler unicorn pg I get this: Permission denied -

[Rails] Re: Need help even generating a new app

2013-01-14 Thread Josh Aronoff
Ok. got to Step 3: and then ran into this:: Installing yaml-0.1.4... BUILD FAILED Inspect or clean up the working tree at /var/folders/3r/hdtty71s32bd26yrzyq4m5lrgn/T/ruby-build.20130114234238.25080 Results logged to /var/folders/3r/hdtty71s32bd26yrzyq4m5lrgn/T/ruby-build.20130114

[Rails] Re: Need help even generating a new app

2013-01-14 Thread Josh Aronoff
thank you! I'll try this and let you know how it went!! Thanks for responding! -- 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-talk@googlegroups.

[Rails] Need help even generating a new app

2013-01-14 Thread Josh Aronoff
I'm having trouble even installing new rails apps. I get to the Bundle run, and it errors on Json, here's what my error says. I'm new to ALL of this, including Terminal commands, etc. Hope someone can help me out. Runs the Bundler then I error out at this: "Installing json (1.7.6) with native

[Rails] devise - multi step registration with different models

2012-09-21 Thread Caleb Josh
Hi All, Kindly help me to sort this out.. I have devise sign up page. But now I want to integrate multi step registration. i.e) first, user will enter his/her email pwd and confirmation password. Will click on Next button where he fills in his personal details and on clicking Next button will s

[Rails] Re: api.rubyonrails.org previous versions?

2012-07-14 Thread Josh
in in the same format. On Wednesday, July 11, 2012 3:12:37 PM UTC-4, Josh wrote: > > First, let me say that api.rubyonrails.org is awesome. Whoever is > hosting it - thank you. It blows all the other api tools out of the water > in terms of usability. Yay! > > T

[Rails] api.rubyonrails.org previous versions?

2012-07-11 Thread Josh
ained and supported. What about any other old version. I'm sure some folks would find this very useful. It is exceedingly difficult to get decent-to-use docs for old versions of rails. Think we can make that happen somehow? Love, Josh P.S. Same could be said for the guides.rubyonrails

[Rails] asset pipeline questions

2012-03-13 Thread Josh
1) Why does an image that is known to have not changed ( a visa logo ) have 3 different versions on one server, and 4 different versions on another. These two servers are in different environments: ls -la public/a/visa-* -rw-r--r-- 1 rails rails 1506 2012-03-04 06:33 public/a/visa-2c267b881e96

[Rails] Can't create new rails project behind proxy

2012-01-11 Thread Josh J.
When I run: rails new I get the following error: Fetching source index for http://rubygems.org/ Could not reach rubygems repository http://rubygems.org/ Could not find gem 'turn (>= 0) x86-mingw32' in any of the gem sources listed in your Gemfile. I think the problem is that I'm behind a proxy.

[Rails] maintenance page with 3.1 and assets pipeline

2011-11-02 Thread Josh Sharpe
Prior to 3.1/pipeline, adding a maintenance page was as simple as dropping a file in place on the server, and a apache rewrite rule. Now... all my assets are dynamic. So the files that are referenced by my static maintenance.html file change, and break. Has anyone come across a nice solution fo

[Rails] Re: can't compile assets on prod due to asset_host config && SSL requirement

2011-09-06 Thread Josh
bump On Sep 2, 3:22 pm, Josh wrote: > My production asset_host config looks like this: > >   config.action_controller.asset_host = Proc.new { |source, request| >     if request.ssl? >       "#{request.protocol}#{request.host_with_port}" >     else >  

[Rails] SSL routes and functional tests

2011-09-06 Thread Josh
If I wrap my SSL required routes in a block like this: scope :protocol => "https://";, :constraints => { :protocol => "https://"; } do resources :users, :only => [:new, :create, :edit, :update] end then all my functional tests that reference those routes are now spitting out RoutingErrors. Som

[Rails] SSL routes and functional tests

2011-09-06 Thread Josh
If I wrap my SSL-required routes in a block like this: scope :protocol => "https://";, :constraints => { :protocol => "https://"; } do match '/signup' => 'users#new', :as => :signup, :via => :get -- You received this message because you are subscribed to the Go

[Rails] SSL routes and functional tests

2011-09-06 Thread Josh
If I wrap my SSL-required routes in a block like this: scope :protocol => "https://";, :constraints => { :protocol => "https://"; } do match '/signup' => 'users#new', :as => :signup, :via => :get -- You received this message because you are subscribed to the Go

[Rails] can't compile assets on prod due to asset_host config && SSL requirement

2011-09-02 Thread Josh
My production asset_host config looks like this: config.action_controller.asset_host = Proc.new { |source, request| if request.ssl? "#{request.protocol}#{request.host_with_port}" else "#{request.protocol}assets#{(source.length % 4) + 1}.example.com" end } ...which is

[Rails] Re: 3.1 development and the asset pipeline

2011-08-31 Thread Josh
> that make sure that you don't autoload all the models if you use mongoid. > > > > > > > > On Wed, Aug 31, 2011 at 11:21 AM, Josh wrote: > > I understand the difference between dev and prod. > > > The issue here is that in 3.0, a dev page load took hal

[Rails] Re: 3.1 development and the asset pipeline

2011-08-31 Thread Josh
en the files change and serves up the cached version > otherwise. > > Dieter Lunnhttp://ubiety.ca > > > > > > > > On Wed, Aug 31, 2011 at 1:12 PM, Josh wrote: > > With the release of 3.1, it seems that things have drastically changed > > in the development w

[Rails] 3.1 development and the asset pipeline

2011-08-31 Thread Josh
With the release of 3.1, it seems that things have drastically changed in the development workflow. With the asset pipeline enabled, and the likes of this in my layouts: = stylesheet_link_tag 'application', :debug => Rails.env.development? = javascript_include_tag 'application', :debug => Rails.e

[Rails] Re: 3.1rc8 - posting files in a test no longer works

2011-08-31 Thread Josh
> fixture_file_upload should still work Worked for me. Thanks. -- 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, send email to rubyon

[Rails] 3.1rc8 - posting files in a test no longer works

2011-08-30 Thread Josh
A previously working test, that posted a file object no longer works in the latest 3.1. The test looks like this: params[:media][:new_attachment] = File.open("#{Rails.root}/test/data/ less_than_100.png") post :create, params In the controller, I obviously expect params[:media][:new_attachment] t

[Rails] Re: How to use an ActiveRecord plugin in a non-Rails project

2011-05-29 Thread Josh Cheek
On Sat, May 28, 2011 at 7:32 AM, Josh Cheek wrote: > > I was thinking I could probably fork it, give it a gemspec, and then tell > Bundler to look at my forked repo, does that sound reasonable? > > I ended up doing this. https://github.com/JoshCheek/acts_as_list Add one fairly s

[Rails] How to use an ActiveRecord plugin in a non-Rails project

2011-05-28 Thread Josh Cheek
I'm using ActiveRecord on a Sinatra app. I need one of my tables to be sorted, so I'm using acts_as_list (https://github.com/swanandp/acts_as_list). However, it isn't a gem, so I don't know how to get it to work with Bundler. Currently, I just cloned the source into a dir named "vendor". This work

[Rails] vendoring rails the good ol' fashioned way

2011-04-25 Thread Josh
rails 3.0.7 here. 'bundle package' dumps 29MB into vendor/cache and 129MB into vendor/ rails That seems to arbitrary and unnecessary. How do I install rails to vendor/rails these days? 'rake rails:freeze:gems' used to work great, now what? Tried this: Gemfile: gem 'rails', '3.0.7', :path =>

[Rails] Re: rails 3 time breakdowns don't add up

2011-04-16 Thread Josh
production isn't bad at all: Completed 200 OK in 24ms (Views: 19.5ms | ActiveRecord: 2.2ms | Sphinx: 0.0ms) However, it's highly annoying to wait for 1 second requests in development - rails 2.x wasn't like this. -- You received this message because you are subscribed to the Google Groups "Ruby

[Rails] Re: rails 3 time breakdowns don't add up

2011-04-16 Thread Josh
> What did you upgrade from? 2.3.11 > > Have you upgraded the ruby version also? ree, latest > > Are you running in production mode? no - this is in development > > What OS are you running under? OSX for dev > > Colin -- You received this message because you are subscribed to the Google Groups "

[Rails] rails 3 time breakdowns don't add up

2011-04-16 Thread Josh
Ever since upgrading an app to rails 3.0.5 the time breakdowns at the bottom of each action don't come close to adding up. Further, the app feels significantly slower. Completed 200 OK in 1684ms (Views: 165.1ms | ActiveRecord: 6.6ms | Sphinx: 0.0ms) 165 + 6 + 0 isn't anywhere close to 1684. All

[Rails] [ANN] Gotham Ruby Conference Call For Proposals

2011-04-04 Thread Josh Knowles
The Gotham Ruby Conference (GoRuCo), a one-day, single-track event in New York City, is now accepting proposal papers. GoRuCo will be held on Saturday, June 4th, 2011 on the Manhattan campus of Pace University. GoRuCo is a technical conference aimed at highly motivated programmers interested in al

[Rails] dev.rubyonrails.org is down

2011-03-01 Thread Josh
http://www.downforeveryoneorjustme.com/dev.rubyonrails.org ...and not just for me. So, rails:freeze:edge is baroken - could the powers that be please take a look at this? Thanks! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post

[Rails] Ruby on Rails Job Board

2011-02-07 Thread Josh Waybill
Hi, I am wondering if you guys know of any good places to post a job for Ruby on Rails developers? Which job boards do most people use? Our current posting is at: http://jobs.github.com/companies/Digital%20Waybill -- Posted via http://www.ruby-forum.com/. -- You received this message because y

[Rails] Re: Rails novice with a new project!

2011-01-24 Thread Josh M
I was thinking I'd migrate from the built in sqlite to MySQL when deployment time comes. Are there any comparative advantages/disadvantages of MySQL compared to PostgreSQL or any of the other options I should be aware of? On Jan 24, 12:58 pm, comopasta Gr wrote: > Josh M wrote in post #97

[Rails] Rails novice with a new project!

2011-01-23 Thread Josh M
Hi! I am embarking on my first ever rails project (yay!) and would like to solicit any advise or warnings while I'm in the planning stage. Here is the impetus for my project: I am product supply manager at a small research company. I inherited a really clunky, buggy inventory management system.

[Rails] Re: Rails way of constructing an url with post parameters of a form

2011-01-19 Thread Got Josh?
Any help anyone? :( On Jan 18, 5:47 pm, "Got Josh?" wrote: > I already did it, but perhaps you can point me in a better way. > > I made a class called Booking Information:https://gist.github.com/785209 > > Where I'll store the post parameters of my interest li

[Rails] Re: Rails way of constructing an url with post parameters of a form

2011-01-18 Thread Got Josh?
roperty an chain and propertyID must be assigned) On Jan 18, 5:36 pm, Frederick Cheung wrote: > On 18 Jan 2011, at 18:52, "Got Josh?" wrote: > > > I would like to do that's the best way of actually accomplishing the > > following on Rails. > > > I hav

[Rails] Rails way of constructing an url with post parameters of a form

2011-01-18 Thread Got Josh?
I would like to do that's the best way of actually accomplishing the following on Rails. I have a "Booking Form" with 5 fields (Property, Amount of Children, Amount of Adults and 2 Dates - Departure and Arrival) based on these fields, I need to construct an URL and redirect the user to this url. N

[Rails] config.plugins breaks w/ bundler?

2010-11-17 Thread Josh
= [ 'exception_notification', 'ssl_requirement', 'sphinx', 'ssl_requirement', 'strip_attributes', 'subdomain-fu', 'validates_date_time', 'xss_terminate'] end ...but this feels like a bit of hack. Am I doing someth

[Rails] (Jobs) RoR Developer in Silicon Valley

2010-11-15 Thread Josh Powell
Rocket Fuel, Inc. is seeking an experienced Web Application Developer to join our growing team at our headquarters in Redwood Shores, CA. You will be responsible for implementing rich internet applications that help us manage and visualize the substantial real-time data generated by our proprietary

[Rails] inconsistent validate_uniqueness_of & :scope behavior?

2010-11-01 Thread Josh Kram
(Rails 2.3.4) Can't quite figure out what I'm doing wrong but I'm seeing different behavior for validates_uniqueness_of between two models that look more ore less identical to me -- I have a model called Person: class Person < ActiveRecord::Base validates_uniqueness_of :first_name, :scope => :l

[Rails] Re: Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Josh Nathan
PHILIP Thanks thats why I was really looking for, I'll research thay as come back with anymore questions in regards to those points, any further info would still be great. Best regards Josh -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: T

[Rails] Re: Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Josh Nathan
s are tight on this and I / we only wanted a bit of help. I will happily post our brief if it helps. We just need help due to the vagueness of the report and the vagueness of the lectures. Sorry for any inconvenience. Regards Josh -- You received this message because you are subscribed to the Googl

[Rails] Re: Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Josh Nathan
I and the rest of my group are students at the university collage london. We have had little or no experience in the world of information systems. It just happens to be an unfortunate part of our course that we have to complete this module. To Michael - before spouting off and being rather small mi

[Rails] Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Josh Nathan
We have been ask about how Ruby on Rails could be intergrated into a 3- tier architecure for produce a single intergrated source of student data and information. It would included both adminstrative and public records etc. Any information on how Ruby on Rails could be used in this sense sucesfully

[Rails] redirect_to && referrer

2010-08-23 Thread Josh
Contrived example: class WelcomeController < ApplicationController def first logger.debug "REFERRER: #{request.referrer}" logger.debug "REQUEST_URL: #{request.request_uri}" redirect_to :action => :second end def second logger.debug "REFERRER: #{request.referrer}" logger.

[Rails] reload is using a cache and i dont want it to be

2010-08-10 Thread Josh
class PendingOrder < ActiveRecord::Base def sleep_until_processed sleep 0.5 while !processed? reload sleep 0.25 end end end Aug 10 19:43:38 prod-app1 foo[31608]: PendingOrder Load (0.6ms) SELECT * FROM `pending_orders` LIMIT 1 Aug 10 19:43:39 prod-app1 foo[31496]: CACHE

[Rails] Re: Sweeper class doesn't work

2010-07-18 Thread Josh Ellithorpe
Viet, I signed up today just to say you are my savior. I couldn't figure out why the hell my sweeper wasn't working either. Thanks for the working fix. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

Re: [Rails] Re: gsub help

2010-06-09 Thread Josh Cheek
On Wed, Jun 9, 2010 at 9:42 AM, anon_comp wrote: > On Jun 9, 9:37 am, anon_comp wrote: > > Here's my code > > > > def index > > file = "BLAH-ex201588.doc" > > @file_cut = order.gsub(/[\w [- ! # $ % ^ & * = +]+]+\.doc$/, > > '*.doc) > > end > > > > The code worked before when I was using

Re: [Rails] Re: reset restful authentication user password from rails console

2010-05-28 Thread Josh Cheek
On Fri, May 28, 2010 at 9:49 AM, andrew v wrote: > > > On Fri, May 28, 2010 at 6:07 PM, Frederick Cheung < > frederick.che...@gmail.com> wrote: > >> >> >> On May 28, 12:11 pm, andrew v wrote: >> > Hi, >> > >> > I have implemented restful authentication plugin in my rails >> application. >> > It'

Re: [Rails] Re: Site Navigation With Polymorphic Has Many Through

2010-05-26 Thread Josh Cheek
On Wed, May 26, 2010 at 3:09 AM, Tilde Equals wrote: > Josh, > We're doing something similar, except that instead of using childable > and parentable, we're using awesome_nested_set. It enables you to > have sub_categories within sub_categories, etc., and its interface is

[Rails] Site Navigation With Polymorphic Has Many Through

2010-05-25 Thread Josh Cheek
Hi, seem to keep running into a wall here. I can't find any resources on site navigation that can deal with any model being in the nav, allow nesting, and can dynamically update. So I thought about it for a while, and decided on a MenuItems class, which contained the position of the child in relat

Re: [Rails] Ruby Midwest Early Bird Ends Tomorrow

2010-05-14 Thread Josh Cheek
On Fri, May 14, 2010 at 4:50 PM, Luke Pillow wrote: > The Ruby Midwest Conference Early Bird pricing ends tomorrow, Saturday, May > 15. Don't miss out on two full days of great talks, networking, and hacking > for only $75! > > Attendees are also invited to the OMGWTFBBQ (http://bbq.rubymidwest.

Re: [Rails] Re: NameError - Problems with if-else

2010-04-08 Thread Josh _
As an unrelated, but hopefully helpful aside, I'd also recommend not duplicating your markup in both the "if" and "else" sections. Doing things this way quickly gets hard to read and maintain. Better might be: <% if (article.gender == "Male") then color = '#d1e1fa' else color = '#11' end %>

Re: [Rails] Re: Re: count(*) in find :select returns a String? Why not Fixnum?

2010-04-08 Thread Josh _
On Wed, Apr 7, 2010 at 9:30 AM, Andy Jeffries wrote: > The typecasting for a MySQL attribute to a Ruby class is done in the > read_attribute method in > the activerecord/lib/active_record/attribute_methods.rb file. In that method > you can see they only typecast the value if column_for_attribute r

Re: [Rails] Advice on restructuring

2010-04-08 Thread Josh _
On Thu, Apr 8, 2010 at 8:20 AM, johnnybutler7 wrote: > If its not done correctly then further > down the line there could be serious issues as data may be lost etc... > I don't think you're realistically going to avoid having a huge headache if you don't do the migration correctly the first time.

Re: [Rails] Re: POST-only logic in protect_from_forgery considered harmful?

2010-04-08 Thread Josh _
On Thu, Apr 1, 2010 at 7:20 AM, Jeff Lewis wrote: > This seems like a non-issue to me that can and should be handled by > the developer of the app, regardless of what lang/framework you're > using, by following basic best-practices for securing your app against > csrf or sql-injection or ... atta

Re: [Rails] multiple foreign keys

2010-04-05 Thread Josh Cheek
On Mon, Apr 5, 2010 at 3:15 AM, Colin Law wrote: > It would be less effort for us to work out what you are trying to do > if you gave us the model relationships (belongs_to etc). Also if you > show the sql that works it would allow us to see what you mean. > > Colin > Basically I want to say

[Rails] Re: multiple foreign keys

2010-04-05 Thread Josh Cheek
Also having difficulty getting the has_many to work with this. I thought about a separate join table for it,and even got it working with has_and_belongs_to_many :beat , :class_name => 'Player' , :foreign_key => 'winner_id' , :association_foreign_key => 'loser_id' , :join_table => 'games' , :condi

[Rails] multiple foreign keys

2010-04-05 Thread Josh Cheek
elf was player1 or player2 I can get it with find_by_sql, but then my named scopes don't work. Really struggling to figure this out, looked at the guides, the api, googled, and played around, and I'm running out of time and steam. Any ideas? Thanks, Josh. -- You received this messag

Re: [Rails] Re: how to insert a batch of records into db more efficientl

2010-04-01 Thread Josh _
On Thu, Apr 1, 2010 at 8:50 AM, Fitz Fitz wrote: > I have been facing this problem for a while now. ar-extensions is > really good but it doesn't preserve the links between models like > one-to-one many-to-many etc. > Have you tried doing batches via transactions? By default activerecord will m

Re: [Rails] Re: POST-only logic in protect_from_forgery considered harmful?

2010-04-01 Thread Josh _
On Thu, Apr 1, 2010 at 1:08 AM, Frederick Cheung wrote: > Without getting into the debate about how idempotent GET requests > really are I'd suspect that these days most people are using restful > routes. If you use restful routes and remove the default route then > it's not possible invoke (eg)

[Rails] Presentation Ideas

2010-03-22 Thread Josh Cheek
t not very likely. Maybe 20-30 people. Any ideas or advice are welcome, thanks :) -Josh -- 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 fro

Re: [Rails] Some logic problem

2010-03-18 Thread Josh Cheek
On Fri, Mar 19, 2010 at 12:03 AM, Hemant Bhargava wrote: > Hello champs, > > I am in dilemma here. I have structure like this:- > > EmployeeA > | > EmployeeBEmployeeC EmployeeD >

Re: [Rails] How to make an array available to all views.

2010-03-12 Thread Josh Cheek
On Fri, Mar 12, 2010 at 2:59 AM, Andy Jeffries wrote: > > It's dirty, horrible, bad form, breaks the separation of layers... I don't know what you mean by dirty, it saves several lines of code and when looking at the view code it is easier to see what is happening than to see a

Re: [Rails] How to make an array available to all views.

2010-03-10 Thread Josh Cheek
On Wed, Mar 10, 2010 at 11:48 AM, Robert Walker wrote: > 1. What about methods on models that change themselves in some way? > > <%= @post.last_viewed_at %> > > Suppose the last_viewed_at method returned a previously stored time, > then updated the model to store a new current time. Maybe a bad ex

Re: [Rails] Re: Fixnum problem

2010-03-07 Thread Josh Cheek
On Sun, Mar 7, 2010 at 1:15 PM, Manish Belsare wrote: > Sir i have now tried to declare a same method twice with a different > name but the same parameter to both the methods.. > Bt i still get that fixnum problem.. > i want to know that calling two different name methods in on Model file > works

Re: [Rails] Fixnum problem

2010-03-07 Thread Josh Cheek
On Sun, Mar 7, 2010 at 12:04 PM, Manish Belsare wrote: > Sir can i know what is the meaning of the phrase 'comparison of Fixnum > with nil failed' > > I want to pass two parameters to a method in a model file.. > bt wen i pass an integer then it gives the above error.. > Please help..

Re: [Rails] Current state of Rails CMSs

2010-03-03 Thread Josh Cheek
On Wed, Mar 3, 2010 at 11:05 AM, Devin McCabe wrote: > I've been using Rails for many years, but it's been primarily for > building custom applications and hosting small sites with less than ten > pages. I'm interested in learning a CMS to start building more > content-heavy sites. > > The last

Re: [Rails] Re: Tweetstream

2010-03-01 Thread Josh Cheek
On Mon, Mar 1, 2010 at 6:43 PM, Ritchie wrote: > Hi Josh, > > If your overall goal is to run it as a background task on Heroku, I > think you want this: http://docs.heroku.com/background-jobs. > > I don't think that there's any other way to run background jobs on >

[Rails] Re: Tweetstream

2010-03-01 Thread Josh Cheek
Based on their example, I got this to work: -- start code -- require 'rubygems' require 'tweetstream' require 'ruby-growl' username = 'blinkdev' password = **secret** tracks= ['#ROCKPIC'] puts "Starting a GrowlTweet to track: #{tracks.inspect}" TweetStream::Daemon.new(userna

[Rails] Tweetstream

2010-03-01 Thread Josh Cheek
Hi, I want to use the TweetStream gem http://github.com/intridea/tweetstreamin my Rails app I can't seem to figure out how to do it, because it opens a connection and then won't move on. I got it to work in a Ruby script with -- start code -- require 'rubygems' require 'tweetstre

Re: [Rails] make website based on ruby o.o

2010-02-22 Thread Josh Cheek
On Sun, Feb 21, 2010 at 11:33 AM, Law Jer Cherng wrote: > hi guys. It's not my first time on ruby, i mean, well I did get to > page 40 of my 300 page guide book, but that's not the point =S. thing > is, I don't really know what you gotta do to make a blog out of ruby. > I've heard RoR but it's re

[Rails] Re: ActionMailer using wrong layouts on prod box

2010-02-02 Thread Josh
and not Haml's fault On prod Notifier.instance_variable_get("@inheritable_attributes") [:view_paths] is slightly different but looks fine... the rest of that hash is identical. On Feb 2, 2:12 pm, Josh wrote: > Using ActionMailer,  Haml and multi part emails I'm seeing very > strange behavior o

  1   2   >