Re: [Rails-core] Lack of foreign-key constraints support in ActiveRecord

2011-11-28 Thread Mislav Marohnić
On Nov 28, 2011, at 8:04 PM, Mislav Marohnić wrote: > Eventual referential integrity as a result of race conditions was never a > problem for me That was supposed to be "non-integrity" -- You received this message because you are subscribed to the Google Groups "Ruby

Re: [Rails-core] Lack of foreign-key constraints support in ActiveRecord

2011-11-28 Thread Mislav Marohnić
On Nov 28, 2011, at 7:50 PM, Rodrigo Rosenfeld Rosas wrote: > t.references :author > > This should not only create the author_id numeric column, but also create the > foreign key in supported databases. Ah, I didn't understand we're only talking about migrations here. You write too long email

Re: [Rails-core] Lack of foreign-key constraints support in ActiveRecord

2011-11-28 Thread Mislav Marohnić
There are 3 main relational databases that Rails devs care about: SQLite, MySQL and Postgres. SQLite hasn't had foreign key constraints until late 2009 and MySQL only has it on InnoDB tables (not default). So, for the most of Rails' lifetime, FKC support in supported databases wasn't ubiquitous

Re: [Rails-core] Should we put a LICENSE file in the Rails top level project directory?

2011-11-28 Thread Mislav Marohnić
On Nov 27, 2011, at 2:47 PM, Al wrote: > Should we put a LICENSE file in the Rails top level project directory to > define our license. It seems to be done in some open source projects. Each component of Rails has its own copy of license file since they are packaged separately. https://github.c

Re: [Rails-core] Change the default text of /public/500.html?

2011-10-28 Thread Mislav Marohnić
On Oct 28, 2011, at 9:55 PM, WBT wrote: > "We're sorry, but something went wrong. We've been notified about this > issue and we'll take a look at it shortly." I was also always bothered by it. By default, nobody was notified about any issue and they will only take a look if someone tells them or

Re: [Rails-core] A proper way to test that database is not accessed?

2011-10-16 Thread Mislav Marohnić
On Oct 16, 2011, at 7:42 PM, KIR wrote: > What I'm trying to test - that my code doesn't perform SQL operations when > building json, i.e. all data should be preloaded. That's a perfectly valid thing to test. Looks like it might be a regression. I suggest that you update the issue (where you com

Re: [Rails-core] A proper way to test that database is not accessed?

2011-10-16 Thread Mislav Marohnić
On Oct 16, 2011, at 6:22 PM, KIR wrote: >BTW, have you tried your helper on Rails 3.1.1? I haven't tried my code, I just pulled it out of the air. Sorry that I misunderstood your problem – I thought it was about reconnecting. I have the feeling that others also didn't get what you were sayi

Re: [Rails-core] A proper way to test that database is not accessed?

2011-10-16 Thread Mislav Marohnić
On Oct 16, 2011, at 8:35 AM, KIR wrote: > ActiveRecord::Base.establish_connection Rails.env > >I don't quite understand what do you mean here? I know what your problem is. If because of changes to Rails reconnecting to the db by using the old connection doesn't work, then I suggested that

Re: [Rails-core] A proper way to test that database is not accessed?

2011-10-15 Thread Mislav Marohnić
On Oct 15, 2011, at 10:19 PM, KIR wrote: > Any suggestion for a proper way to check that a block of code doesn't access > database? How about: ActiveRecord::Base.establish_connection Rails.env -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core

Re: [Rails-core] Unobtrusive Image Mouseover

2011-10-15 Thread Mislav Marohnić
On Oct 14, 2011, at 6:58 PM, Tim Shaffer wrote: > Is there any specific reason I'm not aware of that Rails still uses inline > JavaScript for this? Would there be any reception if I were to submit a pull > request for this? Never contributed to rails before so I'm not sure. Thanks! I don't thin

[Rails-core] Rails 3.1: why ".css.scss" and ".js.coffee" extensions?

2011-05-22 Thread Mislav Marohnić
Rails 3.1 generators* create stubs for ".css.scss" and ".js.coffee" files in "app/assets/" directory. Why the double extension? It made sense in view templates (e.g. "index.html.erb") because of the request formats and the fact that some template engines can render multiple types of output, not ju

Re: [Rails-core] Re: CSRF protection in rails 2.3.11

2011-02-19 Thread Mislav Marohnić
On Sat, Feb 19, 2011 at 04:37, Jimmy wrote: > on our homepage we > have a login form. Whether this login form has the authentication > token or not doesn't matter anymore, login always succeeds. Even with > cookies disabled. Previously it would not. How is this a security flaw? Login only succ

[Rails-core] Rails 2.3.9 breaks sessions with Active Record or Memcache store

2010-09-08 Thread Mislav Marohnić
A Rails 2.3.9 app with Active Record or Memcache session store will never send the session ID cookie to a client if the client doesn't send any HTTP cookies in its requests. Rails integration tests didn't catch this because they always send the HTTP_COOKIE header, even if it's empty. This is a hug

Re: [Rails-core] Re: Overly aggressive constant unloading of Rails 3.0

2010-08-23 Thread Mislav Marohnić
Jose: I can't see a fix in 3-0-stable. I'll test on master. Is there a lighthouse ticket for this? Is it definitely fixed? On Sun, Aug 22, 2010 at 17:36, Mateo Murphy wrote: > > Out of curiosity, why is loading the contents of app threadsafe but not > lib? Is it simply a question of the kinds o

[Rails-core] Overly aggressive constant unloading of Rails 3.0

2010-08-17 Thread Mislav Marohnić
In Rails 3.0 (both RC and edge), any constant that's defined while loading a file in development mode will get unloaded on each request, regardless of whether it comes from an autoload path in the application or from external code such as a gem. Example file (tested on a fresh edge app): # kitt

Re: [Rails-core] iframe form send & ujs

2010-08-09 Thread Mislav Marohnić
I've done similar work in our project. What I wanted to do is enable RJS after iframe uploads, too. So I did this hack which renders RJS as javascript string in the iframe which is eval'd in the scope of the main pag

Re: [Rails-core] Re: Weird Rails3 ActiveRecord results when using count and limit together

2010-08-03 Thread Mislav Marohnić
In my opinion, this should never return a value larger than 5: Model.where(blah blah).order(blah blah).limit(5).count Intuitive? Counter-intuitive? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to r

Re: [Rails-core] Re: 3.0.0rc ActionController::RoutingError No route matches

2010-07-27 Thread Mislav Marohnić
On Tue, Jul 27, 2010 at 22:43, Michael Koziarski wrote: > > This is the way to do it properly :). / is a separator in routes, and > if you want it to be included in the :id parameter you'll need to > escape it. The same issue bit me when I included usernames in the URL and one username had a pe

Re: [Rails-core] How to disable ORM in Rails 3

2010-07-26 Thread Mislav Marohnić
On Sat, Jul 24, 2010 at 21:57, Yehuda Katz wrote: > rails new myapp --skip-active-record Right, so how about changing an existing app to not use ActiveRecord? The app generator doesn't allow generating over existing files (a decision I don't understand). And even if it did, we would have to ove

Re: [Rails-docs] Re: [Rails-core] Docs: revised READMEs for Rails frameworks

2010-07-22 Thread Mislav Marohnić
On Tue, Jul 20, 2010 at 01:42, Xavier Noria wrote: > > Excellent work Mislav! > > My only remark is about this sentence > > "With Ruby on Rails framework, users only interface directly with > Action Controller module." > Improved and pushed! http://github.com/lifo/docrails/compare/4ed9bd643...3e

[Rails-core] Docs: revised READMEs for Rails frameworks

2010-07-19 Thread Mislav Marohnić
I have revised READMEs for Action Pack, Active Record, Action Mailer and Active Support. The introductory text in the first two frameworks has gone through substaintial changes, and all 4 have copies of improved "download / installation / support" sections: http://github.com/mislav/rails/compare/bc

Re: [Rails-core] Giving observers their own directory

2010-07-16 Thread Mislav Marohnić
On Fri, Jul 16, 2010 at 13:34, Paul Campbell wrote: > Given that mailers now have their own directory by default in > app/mailers, should the same thinking be applied for putting observers > in app/observers or app/models/observers? "app/models/observers" would be fine by me, but I don't think

Re: [Rails-core] Observers not firing on edge

2010-07-16 Thread Mislav Marohnić
Hey Paul, I replied to a newer thread on the subject. Please do debugging steps as indicated there. On Thu, Jul 8, 2010 at 21:30, Paul Campbell wrote: > On Thu, Jul 8, 2010 at 7:50 PM, Mislav Marohnić > wrote: > > On Thu, Jul 8, 2010 at 16:55, Paul Campbell wrote: > >> &

Re: [Rails-core] Observers are not loading in development mode (Rails 3 beta 4)

2010-07-16 Thread Mislav Marohnić
On Thu, Jul 15, 2010 at 18:46, Stijnster wrote: > > I load my observers from the application.rb file like this; > >config.active_record.observers = :admin_observer, > 'Message::MailObserver', 'Message::EventObserver' > That's correct. This syntax hasn't changed. When I change my developmen

Re: [Rails-core] Rake tasks in production, application models, and Rails 2.3.8-3.0

2010-07-15 Thread Mislav Marohnić
On Thu, Jul 15, 2010 at 07:03, Michael Koziarski wrote: > > That has a few potential side effects, but how does this look for the > 2-3-stable change: http://gist.github.com/476526 Looks good. Why just 2.3-stable? -- You received this message because you are subscribed to the Google Groups "Ru

Re: [Rails-core] Rake tasks in production, application models, and Rails 2.3.8-3.0

2010-07-14 Thread Mislav Marohnić
On Wed, Jul 14, 2010 at 05:48, Michael Koziarski wrote: > self.dependency_loading = false > How about changing that line to: self.dependency_loading = defined?($rails_rake_task) && !!$rails_rake_task Good idea? -- You received this message because you are subscribed to the Google Group

Re: [Rails-core] Rake tasks in production, application models, and Rails 2.3.8-3.0

2010-07-13 Thread Mislav Marohnić
On Mon, Jul 12, 2010 at 02:15, Michael Koziarski wrote: > > Either way, unless you have config.threadsafe! set, this is *clearly* > a bug. And if you do, we should probably force the eager loading to > take place irrespective of whether it's a rake task. You're right, we had threadsafe on. I st

Re: [Rails-core] latest rails.js

2010-07-13 Thread Mislav Marohnić
On Tue, Jul 13, 2010 at 08:21, Andrew Kaspick wrote: > > This version uses document.on and doesn't appear to be compatible with > prototype 1.6.1. Yes, Rails 3 makes heavy use of new event delegation features in Prototype 1.7. > Am I missing something obvious here as to why this > new version

[Rails-core] Rake tasks in production, application models, and Rails 2.3.8-3.0

2010-07-11 Thread Mislav Marohnić
Consider this simple rake task: task :heavy_process => :environment do MyModel.process end The problem I'm seeing here is that this will work in development mode, in which autoloading kicks in when the "MyModel" constant is referenced for the first time, but will *fail* in production mode

Re: [Rails-core] Observers not firing on edge

2010-07-08 Thread Mislav Marohnić
On Thu, Jul 8, 2010 at 16:55, Paul Campbell wrote: > > Most of my issues have gone away, but an after_save observer that was > working fine on beta4 simply isn't being called. I refactored observers a while ago (April), and was the last to work on them (to my knowledge). Their tests still pass,

[Rails-core] Fixed destroy_all regression

2010-07-08 Thread Mislav Marohnić
Hello, I've submitted a patch that tests and fixes destroy_all behavior . The regression is that, in Rails 3, `destroy_all` always returned an empty a

Re: [Rails-core] Re: rails.js etc.

2010-07-06 Thread Mislav Marohnić
On Tue, Jul 6, 2010 at 02:45, Mislav Marohnić wrote: > > I've somehow lost commit access to prototype-ujs. Josh Peek, if you're > reading this, can you restore that for me? > Aaand my commit access is back, and the fixes are pushed: http://github.com/rails/prototype-ujs/com

Re: [Rails-core] Re: rails.js etc.

2010-07-05 Thread Mislav Marohnić
Fully support Nicolás about this not being a place for religious discussions about JavaScript. Michael, did I understand correctly that what you said below in 2 simple sentences were the only things actually *wrong* with the script? On Sun, Jul 4, 2010 at 14:09, michael.hasenst...@googlemail.com <

[Rails-core] auto-link, counter_cache fixes

2010-05-24 Thread Mislav Marohnić
Posting here because Lighthouse seems to have very low signal-to-noise ratio. I've resolved to solve all known auto-link issues, so I went through all related tickets in Lighthouse and ensured I address each one. Result: 2.3.x http://github.com/mislav/rails/compare/2-3-stable...auto_link_2-3-stab

Re: [Rails-core] Should an blank string be html_safe?

2010-05-17 Thread Mislav Marohnić
On Mon, May 17, 2010 at 23:54, David Genord II wrote: > From your example > query = "".html_safe > query << params[:query] # This WOULD be escaped. The << operator is > overwritten to recognize whether what is being appended is html_safe and > escape it if it isn't to maintain an html_safe st

Re: [Rails-core] Should an blank string be html_safe?

2010-05-17 Thread Mislav Marohnić
On Mon, May 17, 2010 at 21:07, RobL wrote: > > Eventually I realised the original empty string was not html_safe I see how you got confused, but this is intentional. All strings are originally not html_safe since there's no way of telling if they came from the author or user input. I don't agre

Re: [Rails-core] Re: In development mode not all types are included in the query related to type

2010-05-12 Thread Mislav Marohnić
When you're querying a parent that doesn't have any non-abstract parent (meaning he's the top of the STI hierarchy), then theoretically you really don't have to know the list of descendants. AR could just make a query without conditions. I think it would be a good addition to AR. Or am I missing s

Re: [Rails-core] Re: In development mode not all types are included in the query related to type

2010-05-12 Thread Mislav Marohnić
Isn't the problem obvious? ActiveRecord cannot list all subclasses under STI until it loads all modes in the app. In development mode it relies on autoloading and never preloads all models. The local solution: require statements in the end of "user.rb": require 'manager' require 'agent' So w

Re: [Rails-core] Routing a Sinatra application

2010-04-23 Thread Mislav Marohnić
I can confirm that this is true. The `recognize_path` lookup failed not because it couldn't find '/nested_application', but because it found it and failed on `route.app.is_a?(Dispatcher)` lookup. `route.app` returns Sinatra::ShowExceptions, which is the first Sinatra middleware on the stack that's

Re: [Rails-core] Bundler caching issues when updating gem locally

2010-04-19 Thread Mislav Marohnić
First of all, this is not a list to discuss Bundler features or development. Ask on #carlhuda Freenode channel. But now that you're here, I can give you advice: bundling versioned gems is only meant for libraries that are not in active development at this moment. For libraries that you current wor

[Rails-core] Active Record observers broken: can't be used for "before" callbacks

2010-04-16 Thread Mislav Marohnić
I was just wondering what about a report that I made almost 2 months ago: Active Record observers broken I think it's a pretty big bug. In Rails 3, creating an observer with a "befo

Re: [Rails-core] Re: Introducing Object#self

2010-04-16 Thread Mislav Marohnić
On Fri, Apr 16, 2010 at 13:44, Jonas Nicklas wrote: > > @users = @users.select(&:admin?) if @admins_only > @users.sort > > I think that is infinitely easier to read and understand (it took me a > while to figure out what the hell your code was doing). Just because > you *can* make everything into

Re: [Rails-core] Re: error_message_on etc. removed - what's the rationale?

2010-04-12 Thread Mislav Marohnić
To clarify: this is the commit I had in mind "Remove input, form, error_messages_for and error_message_on from the framework." http://github.com/rails/rails/commit/cd79a4617421f1b66e905f5da84ff28004e2bedd -- You received this message because you are subscribed to the Google Groups "Ruby on Rails

Re: [Rails-core] error_message_on etc. removed - what's the rationale?

2010-04-12 Thread Mislav Marohnić
If you are talking about view helpers that generate HTML for forms and validation errors, to me it's pretty obvious why they were removed: they were like dynamic scaffold in old versions of rails — one magic method, lots of magic output, no way to easily see and customize what's going on. You could

Re: [Rails-core] Ruby 1.9 + Rails 2.3.5 + UTF8 support a dead end?

2010-04-10 Thread Mislav Marohnić
> > - since no one seriously considers ruby 1.9 ready for production, >nobody is going to spend time merging patches for 1.9 encoding >support, so sending patches is a waste of time All the "points" you listed basically just repeat what you stated here in your last observation. Sending

Re: [Rails-core] Introducing Object#self

2010-04-09 Thread Mislav Marohnić
On Fri, Apr 9, 2010 at 13:26, Joao Carlos wrote: > > filter = %w(with_votes without_votes).include?(params[:filter]) ? > params[:filter].to_sym : :self > Idea.published.send(filter).all I wouldn't call this use case where it would be "extremely handy". Here is better code for it: filters =

Re: [Rails-core] the main source of API docs is master

2010-04-06 Thread Mislav Marohnić
I'd like to jump in with a heads-up to people testing documentation they've written or generating edge docs for themselves: while making a new template for Rails 3 docs (porting Hanna to RDoc >= v2.4) I've discovered a number of bugs in the latest RDoc release

Re: [Rails-core] #2042 "Simplified render breaks with nested models (partials)" in rails 2.3 or 3.0?

2010-03-18 Thread Mislav Marohnić
On Wed, Mar 17, 2010 at 17:29, Stijnster wrote: > To make a long question short; is there an easy way in github to see > on what branch a specific commit was made? On github you probably can't. But in git: git branch --contains ea8488caef The reason github can't show you which branch this

Re: [Rails-core] Using method override to send a PUT request via POST

2010-02-23 Thread Mislav Marohnić
On Tue, Feb 23, 2010 at 15:03, dclane wrote: > > I'm trying to figure out if I need to be anything special beyond > setting a parameter like _method=PUT to get this to work. This is a list for discussing development of Rails core. In the future, post usage questions to Rails-talk group. You hav

Re: [Rails-core] Rails 3.0 beta not tagged on GitHub

2010-02-07 Thread Mislav Marohnić
On Sat, Feb 6, 2010 at 23:29, Mikel Lindsaar wrote: > > Generally release candidates are tagged, but the beta won't be. The > current state of the beta is what is in the github repository right > now. No. That's the current state of edge Rails. The current state of the 3.0.0.beta is the code t

Re: [Rails-core] Re: Class#subclasses

2010-01-27 Thread Mislav Marohnić
On Wed, Jan 27, 2010 at 08:44, Xavier Noria wrote: > That in turn unrolled a series of related utilities that were unused, they > are: > > Object#subclasses_of > Object#remove_subclasses_of > Object#extended_by > Object#extend_with_included_modules_from > Class#remove_subclasses > Cla

Re: [Rails-core] Rails 3 and Gem Plugins

2010-01-20 Thread Mislav Marohnić
On Wed, Jan 20, 2010 at 10:48, Yehuda Katz wrote: > > Another option would be to move it into lib/my_lib/railtie.rb (or whatever) > and require it from my_lib.rb. You can then do require "my_lib/railtie" if > defined?(Rails), since the Rails constant will always be required before > your gems (ch

Re: [Rails-core] Rails 3 and Gem Plugins

2010-01-20 Thread Mislav Marohnić
On Wed, Jan 20, 2010 at 04:45, Yehuda Katz wrote: > > I am working on a blog post now, but the basic idea is that > ActionController, ActiveRecord, etc. are all "plugins" now. So anything that > they can do, you can do too. > During the boot process, their respective "railtie.rb" scripts are req

Re: [Rails-core] Class#subclasses

2010-01-16 Thread Mislav Marohnić
On Sat, Jan 16, 2010 at 12:37, Xavier Noria wrote: > > The guide could warn about AR::Base. We could also redefine > AR::Base.subclasses to match the rest (I'd volunteer). ack says there > are not a lot of occurrences, but it wouldn't be backwards compatible. I can imagine that plugins might us

Re: [Rails-core] Re: Does rails ever automatically bring in a gem?

2010-01-12 Thread Mislav Marohnić
Probably doesn't affect your issue, but is definitely on-topic: There is a known case that Rails (ActiveSupport) loads Hpricot unconditionally: https://rails.lighthouseapp.com/projects/8994/tickets/2469-latest-hpricot-installed-always-loaded-on-rake-tasks-despite-configgem-version On Tue, Jan 12,

Re: [Rails-core] HTML5 form field helpers

2010-01-05 Thread Mislav Marohnić
On Mon, Jan 4, 2010 at 15:31, Stephen Celis wrote: > > Some may feel that something like "text_field_tag 'email', nil, :type > => 'email'" is good enough, but this doesn't work for "text_field" > because any "type" option is overridden to "text" (this could be fixed > with a smaller patch). I s

[Rails-core] Rails 3 cookie_verifier_secret

2009-12-29 Thread Mislav Marohnić
Rails application generator from current master creates two scripts in "config/initializers/": "cookie_verifier_secret.rb" and "session_store.rb". The former is something like: ActionController::Base.cookie_verifier_secret = 'xyz...' ... while the latter is: ActionController::Base.session = {

Re: [Rails-core] Person.first(n) and Person.last(n) to work like Array#first and Array#last

2009-12-12 Thread Mislav Marohnić
On Sat, Dec 12, 2009 at 17:50, Stephen Celis wrote: > > Person.first(5) is a bit sweeter than Person.all(:limit => 5) I'm not sure. AR::Base subclasses don't act like Arrays, so I don't think we should be matching same-named method implementations just for the sake of doing so, regardless of how

Re: [Rails-core] What does rails_xss in Rails 2.3.5 mean for plugin/gem authors?

2009-12-02 Thread Mislav Marohnić
On Wed, Dec 2, 2009 at 20:58, Bruno Michel wrote: > > Nathan Weizenbaum, the author of Haml, has found a solution to this > problem of the order of plugins/gems: he has used > Rails.configuration.after_initialize[1] to do stuff when the rails_xss > is here. I like it. It solves the problem. Ye

Re: [Rails-core] What does rails_xss in Rails 2.3.5 mean for plugin/gem authors?

2009-12-02 Thread Mislav Marohnić
On Wed, Dec 2, 2009 at 20:40, Mislav Marohnić wrote: > > Even if rails_xss initializer is restructured so that a simple `require > 'rails_xss'` is enough, I can't do that from plugin code. > I wanted to say "I can't do that from *gem* code" --

Re: [Rails-core] What does rails_xss in Rails 2.3.5 mean for plugin/gem authors?

2009-12-02 Thread Mislav Marohnić
On Wed, Dec 2, 2009 at 20:37, Jeremy Kemper wrote: > > The rails_xss plugin would need to be restructured a bit to make it > easier to explicitly require and initialize. > > Otherwise users have to explicitly config.plugins = [:rails_xss, > :will_paginate, ...] Yes, this will work for plugins,

Re: [Rails-core] Formal way to reset counters

2009-12-02 Thread Mislav Marohnić
+1 for a public API I've been using this :( http://gist.github.com/247472 On Wed, Dec 2, 2009 at 20:23, dasil003 wrote: > Has there ever been discussion of adding a method to recalculate > counter cache values? > > This seems like it would be useful both for adding counter caches to > existing

[Rails-core] What does rails_xss in Rails 2.3.5 mean for plugin/gem authors?

2009-12-02 Thread Mislav Marohnić
A will_paginate user opened a issue in my tracker saying that he wants to use will_paginate in a Rails 2.3.5 app using the rails_xss plugin. Evidently, HTML output from will_paginate view helpers (`page_entries_info` specifically) isn't marked "safe", so rails_xss escapes the HTML which is clearly

[Rails-core] Re: will_paginate to Rails 3: ActionView, routing oddities

2009-11-10 Thread Mislav Marohnić
On Tue, Nov 10, 2009 at 04:58, Joshua Peek wrote: > > The failing default route tests are a problem with your test fixtures. Now > you must define > "FooController" if you are going route to it. Or you can > use with_controllers! ['foo', ...]. > Thanks. I put this before my routes declaration:

[Rails-core] Re: will_paginate to Rails 3: ActionView, routing oddities

2009-11-08 Thread Mislav Marohnić
I have submitted tickets for some of the above mentioned issues: - ActionView::Base#assigns - SelectorAssertions loading

[Rails-core] Re: will_paginate to Rails 3: ActionView, routing oddities

2009-11-08 Thread Mislav Marohnić
On Sat, Nov 7, 2009 at 16:08, Eloy Duran wrote: > > You shouldn't need to instantiate a view yourself anymore. The test case > will set this up for you when render is called and assign the test case > instance variables to it. The theory is that you should be able to work with > it as from a cont

[Rails-core] will_paginate to Rails 3: ActionView, routing oddities

2009-11-07 Thread Mislav Marohnić
Last night I tried making necessary changes to the "agnostic" branch of will_paginate so it would work with Rails 3. http://github.com/mislav/will_paginate/commits/rails3 My ActionView specs were failing miserably. First they wouldn't run because of this require: require 'action_controller/as

[Rails-core] Re: RAILS_ENV hardcoded in too many places

2009-10-18 Thread Mislav Marohnić
On Fri, Oct 16, 2009 at 05:28, Andrew Bloom wrote: > > Wouldn't it make more sense to set it in the vhost (if you're using > Passenger) or with your Mongrel config (or the like). I write app's > that live on many environments (qa, stage, prod, admin, ci, dev, test, > etc.) and have never once had

[Rails-core] Re: RAILS_ENV hardcoded in too many places

2009-10-15 Thread Mislav Marohnić
On Wed, Oct 14, 2009 at 05:11, B.A. 'Bad Attitude' Baracus wrote: > > It does seem like a bad idea to have it hardcoded to development in > initializer.rb. > Well, somewhere it *does* have to default to "development". > > I've never run into your problem, though. quick fix: set RAILS_ENV to > t

[Rails-core] Re: RAILS_ENV hardcoded in too many places

2009-10-14 Thread Mislav Marohnić
On Wed, Oct 14, 2009 at 22:39, Michael Koziarski wrote: > > Also, the default generated test_helper hardcodes RAILS_ENV to test > > (or used to, I didn't check master). I guess that's the best place, > > but thought I'd mention it in case it is relevant to your patch. > > I dunno about changing t

[Rails-core] RAILS_ENV hardcoded in too many places

2009-10-13 Thread Mislav Marohnić
The default value for RAILS_ENV is set to "development" in initializer.rb, which is loaded right after boot.rb has determined the boot strategy. I created a "config/preinitializer.rb" which was supposed to provide another default value for RAILS_ENV ("staging" or "production", depending on the host

[Rails-core] Re: Long CruiseControl notifications are irritating ...

2009-09-04 Thread Mislav Marohnić
On Thu, Sep 3, 2009 at 19:32, Chad Woolley wrote: > > 3. Help fix the build :) > If there are three commits—A, B and C, where A breaks the build and B,C are unrelated—I'm wondering why should CI send out emails for errors in B and C when it detected them in A. In other words, CI should never re

[Rails-core] Re: Rails scaffold on 3.0

2009-08-11 Thread Mislav Marohnić
On Tue, Aug 11, 2009 at 22:41, Mark Turner wrote: > > I would argue that we don't make HTML5 anything close to a default > until at least after October when the "last call" working draft is > finished. Oh, you might wanna take a look at this then: http://github.com/rails/rails/commit/01d92021e6

[Rails-core] Re: Rails scaffold on 3.0

2009-08-11 Thread Mislav Marohnić
On Tue, Aug 11, 2009 at 16:19, Ryan Bates wrote: > > Here's my say on the points. > > 3) -1 Keep it but use instead of Ryan, here you're encouraging the exact type of cargo cult markup which—in my opinion—Rails should stop teaching, and these changes are the right opportunity to do that. Bl

[Rails-core] Re: Rails scaffold on 3.0

2009-08-11 Thread Mislav Marohnić
On Mon, Aug 10, 2009 at 14:31, Albert Llop wrote: > On mislav's comment I just have to add that it makes no sense to use > when you can use , and if you want the scaffold to have labels show > bold, then use css. Albert, while talking about we were actually talking about markup on "show" page

[Rails-core] Re: Non JavaScript dependent scaffolding solution for record deletion

2009-08-10 Thread Mislav Marohnić
On Mon, Aug 10, 2009 at 13:58, Yehuda Katz wrote: > > Are you suggesting that we just put an inline small form with a submit > button to DELETE the record? I'd be ok with that, provided we're not worried > about the lack of confirmation. > I was just about to suggest that when I read the rest of

[Rails-core] Re: Rails scaffold on 3.0

2009-08-10 Thread Mislav Marohnić
On Mon, Aug 10, 2009 at 11:56, José Valim wrote: > > 1) Should we put forms in a _form partial? On the same way this is the > "best practice", we are adding more code for people to grasp at the > beginning. I agree with the _form partial. All beginner Rails tutorials stress out the DRY convent

[Rails-core] Re: Question about Rails 2.x behavior

2009-08-09 Thread Mislav Marohnić
On Sun, Aug 9, 2009 at 05:19, Yehuda Katz wrote: > > In Rails 2.x, if you have an XML template, and try to render a template > that does not have an XML version, but does have an HTML version, ... Am I the only one that didn't understand this first sentence? How can you *have* an XML template

[Rails-core] Re: state machine

2009-08-08 Thread Mislav Marohnić
On Sat, Aug 8, 2009 at 21:15, Dan Croak wrote: > > I agree with Jeremy. It's a mixin and I imagine could come in handy > for Rails internals at some point. > > Great addition and I'm looking forward to using it. Definitely core material. Signup process? State machine. Shopping, checkout and pay

[Rails-core] Re: Opinion about new finder: :unique

2009-07-31 Thread Mislav Marohnić
On Fri, Jul 31, 2009 at 13:39, Murray Steele wrote: > I have to agree with Mislav and Duncan here, if firstname should be unique, > a finder is not the place to enforce that. Those 2 other "mislav" users > should not be in the database in the first place! There may be a compelling > use-case for

[Rails-core] Re: Opinion about new finder: :unique

2009-07-31 Thread Mislav Marohnić
I'm still not sure what are we tring to solve here. Here's what we have now: User.first(:order => 'id') #=> gets me the first user User.first(:conditions => { :username => 'mislav' }) #=> gets me a specific user I designed the domain model, so I know that "username" is a unique key in the

[Rails-core] Re: problem with retrieving nil dates from MySQL

2009-06-10 Thread Mislav Marohnić
On Tue, Jun 9, 2009 at 23:29, Gee-off wrote: > > I a have a problem with a time- > only field in MySQL returning as nil unless it is exactly > "00:00:00" (HH:MM:SS) as stored in a 'time' datatype. Maybe there's a bug in activerecord that translates "00:00:00" time to ruby nil value? > I've

[Rails-core] Re: Rails 2.3-stable killed to_json

2009-06-01 Thread Mislav Marohnić
On Mon, Jun 1, 2009 at 01:48, Michael Koziarski wrote: > > > I think this was fixed in a commit a few days ago. > > Looks that way to me too. Mislav, are we correct? > I can confirm it is fixed. I was unlucky enough to fetch the 2.3-stable branch right before that update got in. The very next co

[Rails-core] Rails 2.3-stable killed to_json

2009-05-28 Thread Mislav Marohnić
I bumped Rails 2.3-stable branch in our app today and deployed, thinking I'm being a good developer by getting all the bugfixes this way. What I actually did is broke many aspects of our app because all `to_json` calls now return "{}" (hardcoded). Both ways to solve this require changing my code:

[Rails-core] Re: redesigning mass attribute assignment (activerecord 3.0?)

2009-05-26 Thread Mislav Marohnić
On Tue, May 26, 2009 at 19:42, cainlevy wrote: > > I'm still struggling a bit for clear reasons why it might be better to > filter the attributes controller-side or model-side. To me it sounds like a responsibility of the controller. It is the one receiving the parameters, selecting the relevan

[Rails-core] Re: Rails, Activism and Lack of API

2009-05-21 Thread Mislav Marohnić
2009/5/21 Michael Koziarski > > > authentication & authorization: for restful_authentication, authlogic, > etc.; > > This is something I'm *strongly* opposed to including in the core of > rails until we have an absolutely bullet proof and popular solution > from various plugins. yehuda and carl

[Rails-core] Re: Rails, Activism and Lack of API

2009-05-20 Thread Mislav Marohnić
Here are some ideas for parts of the future public API: - monitoring & profiling: hooks for NewRelic/TuneUp/Scout instrumentation; - ActiveRecord fulltext search & indexing: for Sphinx and other plugins. the core implementation, however, would be just using common RDBMS features suc

[Rails-core] Re: Finding the loaded plugins?

2009-05-20 Thread Mislav Marohnić
On Wed, May 20, 2009 at 17:08, Michael Schuerig wrote: > > > The problem is that the current Initializer instance isn't saved > > anywhere. > > > > If you change your environment.rb like this: > > > > Init = Rails::Initializer.run ... > > That's not what I want, although I deliberately didn't s

[Rails-core] Re: Rails, Activism and Lack of API

2009-05-20 Thread Mislav Marohnić
On Wed, May 20, 2009 at 19:30, Michael Schuerig wrote: > Hold your horses. Rails having no public API is a mis-statement of a > very real shortcoming. As you point out, a public Application PI is > there indeed. What's missing is a defined interface for people extending > or otherwise hacking Rai

[Rails-core] Re: Finding the loaded plugins?

2009-05-20 Thread Mislav Marohnić
On Wed, May 20, 2009 at 12:32, Michael Schuerig wrote: > > Is there a way to find out which (gem) plugins are loaded without > repeating work the initializer has already done? The problem is that the current Initializer instance isn't saved anywhere. If you change your environment.rb like this

[Rails-core] Re: The tag

2009-05-17 Thread Mislav Marohnić
On Sun, May 17, 2009 at 22:03, David Knorr wrote: > > Now, my question to you is: Which of the above solutions do you > prefer? If you have a completely different solution I would also like > to hear about it. We have a solution that pushes strings to an array and laters joins with a delimiter

[Rails-core] Re: ParamsParser and request body streams

2009-05-16 Thread Mislav Marohnić
On Sat, May 16, 2009 at 09:54, brianmario wrote: > > Exactly. > > What's the next step here? > I can fork Rails and work on a patch, though I'm unsure how many/which > tests will need to be refactored. I don't think existing tests need changes. New tests have to be added: 1. that JSON parse

[Rails-core] Re: Custom Array-like object for partial

2009-04-17 Thread Mislav Marohnić
On Thu, Apr 16, 2009 at 11:26, Ryan Bates wrote: > > I am building a Rails plugin which is somewhat similar to named scopes > and therefore behaves like an array. However it isn't a subclass of > Array I see now that the current check is pretty ugly: if Array === partial_path || (defined

[Rails-core] Re: exceptions while in views

2009-04-15 Thread Mislav Marohnić
On Tue, Apr 14, 2009 at 13:37, pedz wrote: > But since the exception happens in a view, it is wrapped by an > ActionView::TemplateError so the rescue_with_handler does not find my > exception handler. I support this. My controllers mostly set up paginated collections that are lazy loading (i.e.

[Rails-core] Re: listing of Rails contributors

2009-04-02 Thread Mislav Marohnić
This is great. I'd love for its permanent home to be rubyonrails.org/contributors. Two things: 1. did anyone notice the long tail effect? hehe 2. is the list going to be live (think github post-receive hook) On Thu, Apr 2, 2009 at 20:37, Xavier Noria wrote: > > I am happy to announce th

[Rails-core] Re: http://api.rubyonrails.org/ out of date again

2009-03-29 Thread Mislav Marohnić
On Sun, Mar 29, 2009 at 21:01, Xavier Noria wrote: > > On Tue, Mar 24, 2009 at 5:07 PM, Jeff wrote: > > > Can someone who has access to the http://api.rubyonrails.org/ website > > regenerate the rdocs? It doesn't seem to have been updated for 2.3, > > API is 2.3, but I know some bit that was no

[Rails-core] Time to make Rails Trac read only, maybe?

2009-03-22 Thread Mislav Marohnić
The only updates I'm getting nowadays from Trac are spam comments, and they're getting in more often by time. Is it time to lock Rails Trac in read-only mode? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on R

[Rails-core] Re: ActiveRecord::Base#saved_record?

2009-03-18 Thread Mislav Marohnić
On Wed, Mar 18, 2009 at 13:12, Olly Legg wrote: > > It is along the same lines as the invalid? method. It adds a more > readable method for the opposite functionality. The name "saved_record?" might be misleading -- developers might think that this method returns false before the "save" method

[Rails-core] Re: Last call for patches - 2.3 final is imminent

2009-03-10 Thread Mislav Marohnić
Action caching is broken with string keys. This means you cannot cache XML or JSON responses, for instance, if you use a string for cache key. Failing test + fix http://rails.lighthouseapp.com/projects/8994/tickets/1585 --~--~-~--~~~---~--~~ You received this messa

[Rails-core] Re: Session Issues

2009-03-10 Thread Mislav Marohnić
On Tue, Mar 10, 2009 at 17:41, horsfa...@googlemail.com < horsfa...@googlemail.com> wrote: > > I ran into the same thing, I believe it's related to some of the Rack > changes and is resolved in the Passenger 2.1.1 beta. As mentioned on the "last call for patches" thread: Rails 2.3 is not support

  1   2   3   4   5   >