[Rails-core] Time zone bug for :datetime attributes?

2020-03-07 Thread Andrew Kaspick
I've noticed a time zone bug in the following code... https://github.com/rails/rails/blob/f33d52c95217212cbacc8d5e44b5a8e3cdc6f5b3/activemodel/lib/active_model/type/helpers/time_value.rb#L59 That's creating a new time with either :utc or :local. The issue is when using :local, that creates a

Re: [Rails-core] Association cache regression in Rails 6

2019-12-03 Thread Andrew Kaspick
If useful, here's an executable test case I wrote as a starting point: > https://gist.github.com/alipman88/d499739a466f3e6b6746eeccfa567f9a > > (It may be practical to open an issue via GitHub and continue conversation > there, moving forward.) > > On Mon, Dec 2, 2019 a

Re: [Rails-core] Association cache regression in Rails 6

2019-12-03 Thread Andrew Kaspick
l to open an issue via GitHub and continue conversation > there, moving forward.) > > On Mon, Dec 2, 2019 at 8:38 PM Andrew Kaspick wrote: > >> Hello, >> >> I've found a regression in Rails 6 while upgrading my Rails 5.2 app that >> I'm sure is not correct

[Rails-core] Association cache regression in Rails 6

2019-12-02 Thread Andrew Kaspick
Hello, I've found a regression in Rails 6 while upgrading my Rails 5.2 app that I'm sure is not correct behavior but I'd like a core member to confirm or not before I create a PR for it. The root of the problem lies in the association cache in the internals of ActiveRecord. The example below is

Re: [Rails-core] [ActiveRecord] feature request - QueryMethods method that augments the select clause.

2019-11-14 Thread Andrew Kaspick
+1 On Thu, Nov 14, 2019 at 10:50 AM Max Calabrese wrote: > One little pet peeve of mine is that there is no way (afaik) to just add > additional columns to the select clause of a query. Like for example if I'm > joining and want a count or aggregate off the join table: > > User.joins(:answers)

Re: [Rails-core] [Feature][ActiveRecord] `where.or` query method

2019-10-10 Thread Andrew Kaspick
I usually resort to using Arel for more complex queries; not as straight forward at first, but very powerful I find. On Thu, Oct 10, 2019 at 10:15 AM Kevin Deisz wrote: > For more complex queries, so syntactic sugar can make this a little more > palatable: > > Author.some.complex.scopes.then {

Re: [Rails-core] [Feature][ActiveStorage] Make a preview from a middle frame of the attached video

2019-10-01 Thread Andrew Kaspick
Or passing a frame: option that accepts a specific frame number or a flag such as :middle. On Mon., Sep. 30, 2019, 11:15 p.m. Dmitriy Shcherbakan, < some.nug...@gmail.com> wrote: > Currently, if you want to make a preview for a video file > ActiveStorage::Previewer::VideoPreviewer will pick the

Re: [Rails-core] Re: Rails route URL helpers in JavaScript

2019-01-29 Thread Andrew Kaspick
I use data-* attributes as well or pass the urls back to the client via json generated on the server. On Tue, Jan 29, 2019 at 4:20 PM Piotr Szmielew wrote: > I feel that exposing all routes through JS would be a huge security issue. > > Using data URL attributes would be fine - exposing only

Re: [Rails-core] Rails route URL helpers in JavaScript

2019-01-25 Thread Andrew Kaspick
I've generally got around this issue by including helper generated urls in data-* attributes or in json generated on the server, but perhaps there's situations where those solutions don't work. On Fri, Jan 25, 2019 at 9:08 AM Bogdan Gusiev wrote: > Good Morning, > > Rails route URL helpers are

Re: [Rails-core] Re: [Feature][ActiveRecord] Find records with present attribute value more easily

2018-12-06 Thread Andrew Kaspick
class ApplicationRecord < ActiveRecord::Base scope :not_blank, ->(field) { where.not(field => nil) } # or where.not(field => ['',nil]) depending on your needs end And you're done. As you can see above, what does 'exists' or 'present' mean? Not nil, or not nil and an empty string or maybe just

Re: [Rails-core] [Feature][ActionView]Add :strip_tags option to truncate helper

2018-10-25 Thread Andrew Kaspick
I think the proper way to do what you want is content_tag(:p, truncate("Once upon a time in a world far far away")) On Thu, Oct 25, 2018 at 7:16 PM arsen oganesian wrote: > Hello everybody! > I made a little improvement to ActionView::Helpers::TextHelper#truncate – > added strip_tags: true

Re: [Rails-core] [Feature][ActionView] A helper to conditionally add classes

2018-10-15 Thread Andrew Kaspick
Your code will be cleaner if you pass the classes in as an array. <%= content_tag :div, content, class: ['a', 'b', nil, 'c'] %>; the nil elements will be ignored. Doing that, you can create the array elsewhere in your code however you want and then pass it in. On Mon, Oct 15, 2018 at 9:02 AM

Re: [Rails-core] Making first/last deterministic when using UUID primary keys

2018-09-03 Thread Andrew Kaspick
If I use first/last in my code, I tend to also use an 'ordered' scope as my criteria for order varies from case to case, although I generally use created_at as that criteria. I prefer my code to be more explicit about it's ordering when I'm looking at it anyway. On Mon, Sep 3, 2018 at 4:29 AM

Re: [Rails-core] [Feature][ActiveRecord] Add NULLS LAST ordering to Arel

2018-08-15 Thread Andrew Kaspick
I just use a raw sql string for NULLS LAST. On Wed, Aug 15, 2018 at 4:16 AM harrymaclean via Ruby on Rails: Core < rubyonrails-core@googlegroups.com> wrote: > Hi team! > > We're currently using Arel to dynamically construct complex SQL queries > that power sorting and pagination in our API. One

Re: [Rails-core] Re: [Rails Scaling] Add ability to easily have separate DB for engines

2018-06-25 Thread Andrew Kaspick
I believe rails 6 will have multiple DB support baked in by default... https://speakerdeck.com/eileencodes/railsconf-2018-the-future-of-rails-6-scalable-by-default On Mon, Jun 25, 2018, 6:26 AM Dan Manges, wrote: > This is an interesting idea, thanks for sharing it. We use multiple > databases

Re: [Rails-core] [Feature][ActiveRecord] Belongs_to required option should a accept a Proc

2018-06-11 Thread Andrew Kaspick
I'd say you want required: false with a condition on a validates_associated instead. On Mon, Jun 11, 2018, 11:48 PM Nguyễn Đức Long, wrote: > Whenever we write > belongs_to :association, required: true > or > belongs_to :association, optional: false > Rails will add a presence validator for

Re: [Rails-core] Interactive `rails new`

2018-06-04 Thread Andrew Kaspick
+1 Nice idea. On Mon, Jun 4, 2018 at 5:37 AM Viktor Fonic wrote: > Hi, > > Every time I run `rails new`, I need to pull out the command I use (and > maybe even the template as well). The command I currently use looks like > this: > $ rails new magic --database=postgresql --skip-coffee

Re: [Rails-core] Re: Symlinked templates

2017-08-31 Thread Andrew Kaspick
Sounds like some pretty specific requirements for what you need which is a good candidate for an external gem. On Thu, Aug 31, 2017 at 10:22 AM, Cory Gwin wrote: > I also think partials will be problematic because we don't want the > templates themselves to be in the look

Re: [Rails-core] Issue with time_select view helper defaulting to year 1

2017-07-28 Thread Andrew Kaspick
Unfortunately you can't set an explicit year to be used with a time_select (when the time is nil). The issue is that TZ math IS occurring already implicitly in Rails core when creating a new time object without a timezone. When the year defaults to 1 my times are being offset by 5 hours and 50

[Rails-core] Re: Issue with time_select view helper defaulting to year 1

2017-07-24 Thread Andrew Kaspick
Any comments on why year 1 is used as the default? This appears to have been made as the choice 9 or so years ago. It's an easy change, but it'd be nice to hear a reason why 1 has been used as the default before I open a new PR. On Wed, Jul 19, 2017 at 8:47 PM, Andrew Kaspick <ak

[Rails-core] Issue with time_select view helper defaulting to year 1

2017-07-19 Thread Andrew Kaspick
Currently the time_select helper method defaults to year 1 as seen at https://github.com/rails/rails/blob/master/actionview/lib/action_view/helpers/date_helper.rb#L832 This appears to be an issue when creating new Time values. When assigning the multi-parameter values (time(1i), time(2i), etc)

Re: [Rails-core] [Feature Idea] Allow passing options to ActiveRecord::Persistence#create

2017-05-10 Thread Andrew Kaspick
Use transactions http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html directly. Also, you can't have hashes with keys of the same name. On Wed, May 10, 2017 at 3:16 AM, Idan Attias wrote: > Hi, > > I thought that since this method accepts Hash /

Re: [Rails-core] Begin to contribute code

2016-11-06 Thread Andrew Kaspick
Somewhere to start: http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html On Sun, Nov 6, 2016 at 1:52 PM, vedant agarwala wrote: > Hello everyone, > > I am a fan of rails and I feel I should start giving back to the > community. I am experienced with open

Re: [Rails-core] Warn the developer when using `to:` with an array of emails that he is going to reveal the emails to everyone

2016-10-06 Thread Andrew Kaspick
I don't think anything should be changed to deal with the api personally. The options translate to how email works and to me that's what makes the most sense. Ideally testing would have brought the "error" to your attention before it was used in production. On Thu, Oct 6, 2016 at 7:42 AM,

Re: [Rails-core] [Proposal][Feature Request]Add updated_before, updated_after, created_before, created_after functions for ActiveRecord objects.

2016-07-22 Thread Andrew Kaspick
herit from ApplicationModel, which can >> then be the only place you'd need that code for all your models to use. >> >> Thanks, >> Tom >> On Thu, Jul 21, 2016 at 5:15 PM Andrew Kaspick <akas...@gmail.com> wrote: >> >>> Your updated_between can easily

Re: [Rails-core] [Proposal][Feature Request]Add updated_before, updated_after, created_before, created_after functions for ActiveRecord objects.

2016-07-21 Thread Andrew Kaspick
Your updated_between can easily be accomplished by passing a date range to the where method. ie.start..start+1.day On Jul 21, 2016 5:06 PM, "Will Hennessey" wrote: > Hi Guys, > > It's my first suggestion/post here so go easy on me :p > So recently I've found myself

Re: [Rails-core] [Proposal] [Feature Request] Make new rails apps rubocop compliant

2016-07-16 Thread Andrew Kaspick
Why can't a gem be created that contains rubocop compliant generators and that is used? I see this as a slippery and unnecessary slope to be included directly in rails imo. On Jul 16, 2016 4:24 AM, "Xavier Noria" wrote: > We are talking here about whether to add RuboCop by

Re: [Rails-core] Possible Enhancement method - City.where(name: approximates("york"))

2016-07-08 Thread Andrew Kaspick
Text search is a complex topic and is covered well by many existing gems. I don't believe this should be in Rails core personally. On Fri, Jul 8, 2016 at 7:24 PM, Leonardo Luarte wrote: > There are several times where we are looking for approximate strings, like > parte of

Re: [Rails-core] Partial model validation

2016-05-24 Thread Andrew Kaspick
You can use the context param or a "form object" if you only need to do partial validations. On Tue, May 24, 2016 at 12:12 PM, thomas sevestre wrote: > Hello, > > I've been looking for a solution to perform partial validation of a model. > This is often an issue when you have

Re: [Rails-core] Warn when submitting hashes with same key as string and symbol to AR methods?

2016-03-24 Thread Andrew Kaspick
I'd label this purely as undefined behavior and such cases shouldn't occur in the first place. On Thu, Mar 24, 2016 at 6:59 PM, Andrew Selder wrote: > Hi all, > > After we got bit by it a couple times recently, I was thinking of > submitting a PR for ActiveRecord that

Re: [Rails-core] Bulk INSERTs in Active Record

2016-01-05 Thread Andrew Kaspick
Sounds useful, but likely a better fit for a standalone gem... at least to start. On Tue, Jan 5, 2016 at 9:20 AM, Andrey Novikov wrote: > Hi Greg. > > I am interested in bulk inserts as active Rails user. > > The use cases for that are somewhat rare, but when you need for

Re: [Rails-core] Graceful handling of missing STI constants

2015-01-25 Thread Andrew Kaspick
Why not just use different databases in your different git branches? On Sun, Jan 25, 2015 at 3:42 PM, Maxim Chernyak madfanc...@gmail.com wrote: When using STI, if you introduce a new subclass in a git branch, then create a db record while in it, then switch to another branch, you will get

Re: [Rails-core] Cookie Store - Hash

2015-01-21 Thread Andrew Kaspick
For Rails 5, could you potentially make SHA-256 the default for new apps and opt-in for existing apps? On Wed, Jan 21, 2015 at 5:52 PM, jsmall...@gmail.com wrote: Thanks for this response. I guess that's a question of how big a jump Rails 5 is meant to be. I certainly wouldn't propose this

Re: [Rails-core] Using slim as the default html preprocessor

2014-07-08 Thread Andrew Kaspick
The same conversation has come up when people wanted the default changed to haml years back. ERB is a good default. On Tue, Jul 8, 2014 at 9:09 AM, Luis Ferreira zamith...@gmail.com wrote: Thanks for the response. IMO the amount of boilerplate code that comes with ERB is not only

Re: [Rails-core] Feature Request: Remove or replace *_path helpers for mailers

2014-06-17 Thread Andrew Kaspick
Slight aside, but wouldn't a simple test case catch such an issue? Whether that be an actual mailer test or reviewing a generated email? On Jun 17, 2014 6:14 PM, richard schneeman richard.schnee...@gmail.com wrote: Are there any valid uses for *_path in an email? Can you do reference links

Re: [Rails-core] Allow hash for conditional class attribute in tag helper

2014-03-05 Thread Andrew Kaspick
-1 I don't see why 'class' would get the special treatment when all other attributes could be candidates too and that style is very inconsistent with pretty much all of rails and not particularly clear either. I personally just use a helper if logic is required for attributes. On Wed, Mar 5,

Re: [Rails-core] belongs_to :through

2014-02-25 Thread Andrew Kaspick
Just spend some time reading the api docs from time to time. Not enough devs do this. Or browse the CHANGELOGS. On Tue, Feb 25, 2014 at 2:57 PM, pathé Sene pathe.s...@gmail.com wrote: Rails really rocks! There are many hidden features we don't know yet. I wish that wycats or dhh may

Re: [Rails-core] Convention over configuration and the Rails.root-tmp-folder

2014-02-11 Thread Andrew Kaspick
You're contradicting yourself. The /tmp folder is 100% convention and 0% configuration. Therefore it's all convention over configuration. :) On Tue, Feb 11, 2014 at 1:11 PM, Thomas V. Worm t...@s4r.de wrote: Hi, I started to write a tiny rails app which comes completely as a ruby gem.

[Rails-core] touch_if option?

2013-11-05 Thread Andrew Kaspick
Something that I believe would be useful to prevent overzealous updates via touch would be to allow a lambda to be specified to determine if the touch should occur or not. class Client belongs_to :project, touch: - {|rec| rec.name_changed?} end In this case, the project association is only

Re: [Rails-core] touch_if option?

2013-11-05 Thread Andrew Kaspick
condition. Rafael Mendonça França http://twitter.com/rafaelfranca https://github.com/rafaelfranca On Tue, Nov 5, 2013 at 1:13 PM, Andrew Kaspick akasp...@gmail.com wrote: Something that I believe would be useful to prevent overzealous updates via touch would be to allow a lambda

[Rails-core] errors running rspec tests on 4.0.1.rc4

2013-10-31 Thread Andrew Kaspick
Hello, I have some tests that run fine with rails 4.0 which use factory_girl and rspec and they fail using Rails 4.0.1.rc4 My rspec and factory_girl gems are up to date and the problem only appears once I get on rc4 rails. Has anybody else had issues running there specs using factory girl on

Re: [Rails-core] errors running rspec tests on 4.0.1.rc4

2013-10-31 Thread Andrew Kaspick
Yes I am. I see now that I have 1.0.3 installed. I assume I need 1.0.4 to get going again here. On Thu, Oct 31, 2013 at 10:23 PM, Rafael Mendonça França rafaelmfra...@gmail.com wrote: Are you using protected_attributes gem? On Friday, November 1, 2013, Andrew Kaspick wrote: Hello, I

Re: [Rails-core] errors running rspec tests on 4.0.1.rc4

2013-10-31 Thread Andrew Kaspick
Just installed 1.0.4 and I'm back in business. Thanks for the heads up and help! On Thu, Oct 31, 2013 at 10:27 PM, Rafael Mendonça França rafaelmfra...@gmail.com wrote: Yes. 1.0.3 has a know issue with Rails 4.0.1 that was fixed on 1.0.4 On Friday, November 1, 2013, Andrew Kaspick wrote

Re: [Rails-core] Re: Adding #with to ActiveRecord::Relation

2013-06-08 Thread Andrew Kaspick
He already provided a gist in his reply. On Sat, Jun 8, 2013 at 12:31 PM, James Pinto tap...@gmail.com wrote: could you gist that code for me please, I'd like to take a look at it. On Thursday, May 9, 2013 5:52:42 PM UTC-4, Joshua Wood wrote: Postgres has it: http://www.postgresql.org/**

Re: [Rails-core] Adding #with to ActiveRecord::Relation

2013-05-28 Thread Andrew Kaspick
I'd be interested in seeing your patch for this. If you're not submitting a PR or making it into a gem, can you post a gist of it? Thanks On Thu, May 9, 2013 at 4:52 PM, Joshua Wood joshuaw...@gmail.com wrote: Postgres has it: http://www.postgresql.org/docs/9.2/static/queries-with.html

Re: [Rails-core] Re: My SCSS compiled CSS lacks /assets in the generated urls

2013-02-26 Thread Andrew Kaspick
Open a github issue for the problem; it won't be addressed otherwise. On Tue, Feb 26, 2013 at 9:18 PM, Rodrigo Rosenfeld Rosas rr.ro...@gmail.com wrote: I think I've narrowed down the problem. For some reason this block isn't executed when I run rake assets:precompile:

Re: [Rails-core] Object#tap_if and Object#tap_unless

2013-01-25 Thread Andrew Kaspick
What's wrong with... % if user = account.owner % ... % end % or % if users = account.users.presence % ... % end % ? On Fri, Jan 25, 2013 at 3:17 PM, Ngan nganp...@gmail.com wrote: I originally brought this up in: https://github.com/rails/rails/issues/9067 Rails paved the way for

Re: [Rails-core] Replace Test-Unit with Rspec

2013-01-11 Thread Andrew Kaspick
Popularity is not the deciding factor in what's the default in Rails. Popularity comes and goes and it makes no sense to keep changing defaults to fit the flavour of the month. People say the same thing about ERB vs HAML vs SLIM. If you want a different default, add it to your configuration and

Re: [Rails-core] Only-Except, not_nil?

2012-08-15 Thread Andrew Kaspick
Use a 3rd party lib like http://extensions.rubyforge.org/rdoc/index.html. It has non_nil?, not_nil? blank? and present? probably satisfy most rails devs needs. On Wed, Aug 15, 2012 at 1:35 PM, kuraga kuraga...@mail.ru wrote: 1. Something like: class Array def filter_by_only_except options

Re: [Rails-core] Could we add a new list for engines developers?

2012-07-20 Thread Andrew Kaspick
Engine lists have been created in the past, but they're not very active or are dead. -1 to a new engine list and +1 to just asking the questions in rails-talk first On Fri, Jul 20, 2012 at 7:41 PM, TuteC tuteco...@gmail.com wrote: +1 Agree that a Rails engine is in the frontier between

Re: [Rails-core] Could we add a new list for engines developers?

2012-07-20 Thread Andrew Kaspick
Here's a past one... http://www.mail-archive.com/engine-users@lists.rails-engines.org/ dead! On Fri, Jul 20, 2012 at 8:28 PM, Ryan Bigg radarliste...@gmail.com wrote: rails-talk is a ghetto. A new engines list would be best. On Saturday, 21 July 2012 at 11:27 AM, Andrew Kaspick wrote

Re: [Rails-core] Support for views on activerecord

2012-07-11 Thread Andrew Kaspick
I've been using postgresql views in rails since at least Rails 2.x, maybe even the 1.x days. On Wed, Jul 11, 2012 at 2:41 PM, Gabriel Sobrinho gabriel.sobri...@gmail.com wrote: What do you guys think about adding support to handle database views in active record? Cheers, Gabriel Sobrinho

Re: [Rails-core] Scopes with OR and AND optional chainity discussion

2012-06-21 Thread Andrew Kaspick
Maybe I've missed it, but how do you define precedence between the usual AND's and now OR's? Chaining a bunch of AND's will always results in the same result, but add OR to the mix and now you're complicating things unless you're a lot more explicit with the conditions. On Thu, Jun 21, 2012 at

Re: [Rails-core] Rails API is still pointing to 3.2.3

2012-06-06 Thread Andrew Kaspick
It's 3.2.5 On Wed, Jun 6, 2012 at 4:12 PM, Rodrigo Rosenfeld Rosas rr.ro...@gmail.com wrote: Sorry, but it still seems to be pointing out to 3.2.3 after F5/Shift+F5/Ctrl+F5 in Chrome. Can someone else please confirm it? http://api.rubyonrails.org/ Em 06-06-2012 18:05, Xavier Noria

Re: [Rails-core] LiveSearch in ActiveScaffold

2012-02-28 Thread Andrew Kaspick
Or better yet, don't use this mailing list. Use rails talk. On Tue, Feb 28, 2012 at 10:19 AM, Colin Law clan...@googlemail.com wrote: On 28 February 2012 08:04, Amit gupta amitgupta2...@gmail.com wrote: HI I am using live_search in some of my active scaffold controllers. But live_search

[Rails-core] Re: associations and nested_attributes internals... looking for patch guidance

2011-12-14 Thread Andrew Kaspick
3 weeks later (got busy), here's my patch... https://github.com/rails/rails/pull/3991 On Wed, Nov 23, 2011 at 10:59 AM, Andrew Kaspick akasp...@gmail.com wrote: Hello, I ran into something that works in Rails 3.0.x, but no longer works in Rails 3.1.x and it seems to be valid usage and I

[Rails-core] associations and nested_attributes internals... looking for patch guidance

2011-11-23 Thread Andrew Kaspick
Hello, I ran into something that works in Rails 3.0.x, but no longer works in Rails 3.1.x and it seems to be valid usage and I was wondering if somebody more familiar with the activerecord internals could point me in the right direction... Here's my basic use case using nested attributes:

[Rails-core] patch acceptance

2011-09-06 Thread Andrew Kaspick
I've had some patches (pull requests) ready in github for a while now and I haven't seen much action on them yet. Are there some specific steps that need to be taken other than just submitting a pull request? I noticed some patches have tags associated with them, but I don't know how you add

Re: [Rails-core] patch acceptance

2011-09-06 Thread Andrew Kaspick
to spend a non-trivial amount of time wrapping their head around the issue before feeling confident to accept the PR * Poor code quality * Suggests feature that may or may not be a good idea. Requires thought and discussion. On Tue, 2011-09-06 at 13:30 -0500, Andrew Kaspick wrote: I've had

[Rails-core] SafeBuffer gsub broken

2011-08-13 Thread Andrew Kaspick
Hello, I've run into a bug with the implementation of gsub in https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/string/output_safety.rb My code is essentially this... (my pattern captures values to the global variables $1, $2) text.gsub(pattern) do |match|

Re: [Rails-core] SafeBuffer gsub broken

2011-08-13 Thread Andrew Kaspick
about SaffeBuffer#gsub in https://github.com/rails/rails/issues/1555 -- Guillermo Iguaran Sent with Sparrow On Saturday, August 13, 2011 at 12:42 PM, Andrew Kaspick wrote: Hello, I've run into a bug with the implementation of gsub in https://github.com/rails/rails/blob/master/activesupport

[Rails-core] Minor fix for url_for using hash params

2011-08-11 Thread Andrew Kaspick
Minor fix for url_for where additional values are (incorrectly) set in the hash... Before fix: options = {:controller = 'projects', :action = 'index'} url_for(options) options = {:controller = 'projects', :action = 'index', :host = 'www.example.com', :protocol = 'http'} After fix: options =

[Rails-core] Fix for assert_select_email which is currently non-functional

2011-08-11 Thread Andrew Kaspick
A pull request to fix assert_select_email which is currently non-functional in Rails 3-0 and 3-1... https://github.com/rails/rails/pull/2499 +1's Thanks, Andrew P.S. Other pull requests still waiting for approval in Rails 3-0 and 3-1... https://github.com/rails/rails/pull/2485

[Rails-core] Difference in exists? method behaviour between 2.x and 3.x

2011-08-10 Thread Andrew Kaspick
Sent this to the wrong list before, so here are the two emails I had initially sent... Email I sent yesterday... The following is how exists? works between Rails 2.x and 3.x Rails 2.x User.exists? = true User.exists?(nil) = false Store.first.users.exists? = true

[Rails-core] fixing bug in rails 3.0 stable

2011-08-03 Thread Andrew Kaspick
Hello, What are the requirements for backporting bug fixes to rails 3.0.x from master? I've run into quite a few bugs migrating an app from 2.x to 3.0.x and have found all of them to be fixed in master, but not the 3.0 stable branch. The latest bug that took me a while to track down was an

Re: [Rails-core] ActiveSupport::OrderedHash disappears?

2011-07-14 Thread Andrew Kaspick
Why don't you want to rely on it? It's documented behaviour, so you can totally rely on it. On Thu, Jul 14, 2011 at 5:47 PM, Alexey alexey.mura...@gmail.com wrote: Hello, i have asked this question here: https://www.ruby-forum.com/topic/2140803, but maybe you can answer quickly. Is

Re: [Rails-core] Coffeescript in the default generator?

2011-04-13 Thread Andrew Kaspick
I prefer LESS over SASS, but I see SASS has improved since the last time I used it and taken some much needed pointers from LESS. I didn't look into the SASS improvements enough to know if I'd choose it over LESS yet. coffeescript is interesting and if it's the default now, it'll finally give me

Re: [Rails-core] Re: Enumerable#uniq?

2011-03-16 Thread Andrew Kaspick
Filtering duplicate values should be done in the database layer IMO. On Wed, Mar 16, 2011 at 12:04 PM, Nicolas Cavigneaux nico...@cavigneaux.net wrote: Le 16 mars 2011 à 22:55, Robert Pankowecki a écrit : [ 1, 1, 2 ].uniq? { |x| x 1 } # select Could mean: Is it true that all objects greater

Re: [Rails-core] Re: Postgres adapter optimization for add_column method

2011-02-15 Thread Andrew Kaspick
As a postgres user, +1 to the optimizations. On Tue, Feb 15, 2011 at 7:49 PM, matthewrudyjac...@gmail.com matthewrudyjac...@gmail.com wrote: This is interesting. I think there aren't so many of us using Postgres so quite a few bugs seem to have crept in over time. Perhaps you can also

Re: [Rails-core] Documentation Drive

2010-11-25 Thread Andrew Kaspick
I agree that the new rails 3 docs need a lot of work compared to the 2.3 branch. Methods like before_filter for example, don't even appear in the api docs in the methods pane. And I'm pretty sure a lot of other methods are hidden away in dependent gems now, so they don't show up as core Rails

Re: [Rails-core] Migrations and index problem

2010-11-10 Thread Andrew Kaspick
This is a question for http://groups.google.com/group/rubyonrails-talk/topics, not core. hint: Define you index after the table is created. Use a change_table block. On Wed, Nov 10, 2010 at 10:23 AM, Rodrigo Rosenfeld Rosas rr.ro...@gmail.com wrote:  According to Rails API, it is possible to

[Rails-core] Integration test patch for 2.3.x branch

2010-09-09 Thread Andrew Kaspick
Can this patch be accepted please? https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5301 I posted this a month ago, but haven't seen any further comments on why it may not be getting committed. Thanks -- You received this message because you are subscribed to the Google

[Rails-core] Re: [patch] Integration test patch for 2.3.x branch

2010-08-17 Thread Andrew Kaspick
Please commit this patch (see below) for integration tests... or +1's please. Thanks On Tue, Aug 10, 2010 at 12:32 AM, Andrew Kaspick akasp...@gmail.com wrote: I'll post some more information here which is petty much from the ticket if it helps get the ticket accepted. Currently in 2.3.8

[Rails-core] [PATCH] prototype rails.js fix for forms with multiple submit buttons

2010-08-11 Thread Andrew Kaspick
Hello, Please see my ticket at https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5356 for a fix for supporting multiple submit buttons in forms using the prototype version of rails.js. The ticket goes into more detail. Please let me know of any changes, comments, etc. My

[Rails-core] Re: [patch] Integration test patch for 2.3.x branch

2010-08-09 Thread Andrew Kaspick
it in 2.3.9 if possible. :) On Fri, Aug 6, 2010 at 2:57 PM, Andrew Kaspick akasp...@gmail.com wrote: I know it's only been 2 days, but can somebody commit this patch or give me some more feedback if changes are required... https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5301

Re: [Rails-core] AbstractController in edge docs

2010-08-08 Thread Andrew Kaspick
Gotcha. Thanks for checking things out. On Sun, Aug 8, 2010 at 5:48 AM, Xavier Noria f...@hashref.com wrote: On Sun, Aug 8, 2010 at 12:17 PM, Andrew Kaspick akasp...@gmail.com wrote: Looks good! I took a look at the layout method (original issue) at http://edgeapi.rubyonrails.org/classes

Re: [Rails-core] AbstractController in edge docs

2010-08-07 Thread Andrew Kaspick
Great, thanks for checking it out and figuring out a solution! On Sat, Aug 7, 2010 at 8:31 AM, Xavier Noria f...@hashref.com wrote: On Sat, Aug 7, 2010 at 2:38 AM, Xavier Noria f...@hashref.com wrote: On Fri, Aug 6, 2010 at 11:19 PM, Andrew Kaspick akasp...@gmail.com wrote: Looking at http

Re: [Rails-core] AbstractController in edge docs

2010-08-07 Thread Andrew Kaspick
As a side note, are you aware of the formatting issues for various sections? http://edgeapi.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_many Looks like newlines are being ignored. On Sat, Aug 7, 2010 at 1:26 PM, Andrew Kaspick akasp...@gmail.com wrote

[Rails-core] Re: [patch] Integration test patch for 2.3.x branch

2010-08-06 Thread Andrew Kaspick
I know it's only been 2 days, but can somebody commit this patch or give me some more feedback if changes are required... https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5301 Thanks On Wed, Aug 4, 2010 at 2:55 PM, Andrew Kaspick akasp...@gmail.com wrote: Hello, I've

[Rails-core] AbstractController in edge docs

2010-08-06 Thread Andrew Kaspick
Looking at http://edgeapi.rubyonrails.org/, I don't see any docs for AbstractController. Nothing appears for the layout method for example. Am I missing something or does something need to be changed in the docs to get them to appear? Thanks -- You received this message because you are

[Rails-core] [patch] Integration test patch for 2.3.x branch

2010-08-04 Thread Andrew Kaspick
Hello, I've submitted a patch for an issue in 2.3.8 that I'd like to see committed for 2.3.9 is possible. The patch fixes fixtures being accessible in newly created sessions. Please see the patch for details... https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5301 Thanks

[Rails-core] Re: PATCH remote_function

2010-07-20 Thread Andrew Kaspick
, Jul 17, 2010 at 5:03 PM, Andrew Kaspick akasp...@gmail.com wrote: Updated patch with test... https://rails.lighthouseapp.com/projects/8994/tickets/5138-patch-fix-generated-html-for-remote_function-so-that-ampersands-can-be-used-in-passed-in-options On Sat, Jul 17, 2010 at 3:48 AM, Andrew

[Rails-core] PATCH remote_function

2010-07-17 Thread Andrew Kaspick
I ran into issues using remote_function in beta4. 's that I was trying to pass were always being escaped to amp; even when I passed my input string as html_safe. The code that generates the javascript is all unsafe, so the following patch fixes the issue.

[Rails-core] latest rails.js

2010-07-13 Thread Andrew Kaspick
I found some bugs in the latest beta4 rails.js and noticed an almost completely rewritten version is in edge at the moment... http://github.com/rails/rails/commit/f61d923d284062b4e4864d81c603157020198d06 This version uses document.on and doesn't appear to be compatible with prototype 1.6.1. Am

Re: [Rails-core] latest rails.js

2010-07-13 Thread Andrew Kaspick
/prototype.js If the edge version is 1.6.1 and rails.js depends on 1.7 shouldn't 1.7 be in edge instead then? On Tue, Jul 13, 2010 at 4:50 AM, Mislav Marohnić mislav.maroh...@gmail.com wrote: On Tue, Jul 13, 2010 at 08:21, Andrew Kaspick akasp...@gmail.com wrote: This version uses document.on and doesn't

Re: [Rails-core] latest rails.js

2010-07-13 Thread Andrew Kaspick
Ticket created at https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5109-make-prototypejs-compatible-with-railsjs-for-30 Upgrades prototype.js to be compatible with rails.js On Tue, Jul 13, 2010 at 5:20 AM, Andrew Kaspick akasp...@gmail.com wrote: I updated rails.js, but did

Re: [Rails-core] Default JavaScript library

2010-05-27 Thread Andrew Kaspick
I'd like to see vbscript as the default, but I guess we can wait until Rails 3 ships first. On Thu, May 27, 2010 at 4:57 PM, Ryan Bigg radarliste...@gmail.com wrote: On 28 May 2010 07:24, Norman Clarke nor...@njclarke.com wrote: Why? SQLite3 was made the default database in 2.0.2 and the

Re: [Rails-core] Rails 3 remote form

2010-02-06 Thread Andrew Kaspick
http://ejohn.org/blog/html-5-data-attributes/ On Sat, Feb 6, 2010 at 12:02 AM, molte molt...@gmail.com wrote: According to the Rails 3.0 release notes at http://guides.rails.info/3_0_release_notes.html the ActionView form helper with the :remote option set to true will add a data-remote

Re: [Rails-core] test this is a test do vs def this_is_a_test

2009-12-18 Thread Andrew Kaspick
Good point with... test the truth... I'll have to dig a bit more because my test didn't seem to be replacing anything in the current class. Thanks On Thu, Dec 17, 2009 at 10:57 PM, Michael Koziarski mich...@koziarski.com wrote: What's the purpose for test working this way? It should only be

[Rails-core] test this is a test do vs def this_is_a_test

2009-12-16 Thread Andrew Kaspick
The test method copied below complains when another test of the same name if found in another test file. The following doesn't work... test/integration/users_test.rb test this is a test do ... end test/integration/forums_test.rb test this is a test do ... end but this does work...

[Rails-core] Re: #3088 - [PATCH] Make has_one with :conditions hash scope build or creation of object with those conditions

2009-08-27 Thread Andrew Kaspick
Isn't this stuff that is taken care of by :default on a column when creating migrations? On Thu, Aug 27, 2009 at 12:18 PM, Trek Glowackitrek.glowa...@gmail.com wrote: I like the concept and think it should be expanded to other associations. We already define certain attributes of associated

[Rails-core] Re: To Patch or Not To Patch

2009-08-07 Thread Andrew Kaspick
I just recently wrote my own to get exact results for everything minus the seconds for timing purposes in some logging. So your plugin with :except would have likely done the trick for me. On Fri, Aug 7, 2009 at 8:00 AM, Ryan Angillyangi...@gmail.com wrote: lol @ as per usual  How jaded we've

[Rails-core] patch for absolute paths with the asset helper :cache option

2009-06-05 Thread Andrew Kaspick
Not a blocker, but looking for some +1's... https://rails.lighthouseapp.com/projects/8994/tickets/2766-allow-absolute-paths-for-the-asset-cache-option#ticket-2766-1 Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[Rails-core] Re: What is the best start point

2009-05-07 Thread Andrew Kaspick
http://github.com/rails/rails/tree/master On Thu, May 7, 2009 at 5:44 PM, Houdini dmitrii.go...@gmail.com wrote: Start point to read rails code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails-core] Re: Adding first/last back onto OrderedHash

2009-04-09 Thread Andrew Kaspick
Just a side note... if you're wanting a default for the hash you could use the Hash#default= and Hash#default methods. On Thu, Apr 9, 2009 at 2:41 AM, John Barton jrbar...@gmail.com wrote: On Apr 9, 3:07 pm, Jeremy Kemper jer...@bitsweat.net wrote: On Wed, Apr 8, 2009 at 8:39 PM, John

[Rails-core] ticket: custom month ordering for select_month +1's?

2009-02-16 Thread Andrew Kaspick
Hello, I submitted this patch a while back and it hasn't been picked up yet, so I figured I'd post it here to give it a bit of attention... http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1574 The basics of it are to add an additional option to select_month such as

[Rails-core] Re: Proposed Cache API extensions

2008-12-04 Thread Andrew Kaspick
Could also go with more of a rails convention and have... % cache_for(@record) do % -- user_45_cache which would equate to something like dom_id where it uses the types class and the object id as part of the namespace. The namespace param could be used as well and it would work similar to

[Rails-core] auto_link patch for emails

2008-11-19 Thread Andrew Kaspick
Just wondering if there are any issues with the following patch... http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1418 I was trying to pass :encode = :hex to my auto generated email addresses and realized this wasn't possible. This patch allows options to be passed to a

[Rails-core] Re: support for postgres-pr

2008-11-15 Thread Andrew Kaspick
The pg gem is what you should be using now. On Sat, Nov 15, 2008 at 5:47 AM, Stefan Lang [EMAIL PROTECTED] wrote: The latest version from github doesn't work with the postgres-pr driver. Has support for postgres-pr been dropped? Stefan

[Rails-core] Re: What is the documentation strategy?

2008-10-30 Thread Andrew Kaspick
I don't see any links from one site to the other? What's the purpose of keeping them so seperate? It's nice having docs seperated out by major versions on many sites, so you can actually go back to old docs if you're working on an old project. Edge would be one of those versions avaiable too.

  1   2   >