Re: [Rails-core] small extension to link_to_if

2013-12-17 Thread Tejas Dinkar
never actually used link_to_if, because I haven’t found a use case for it personally. -- Tejas Dinkar http://www.nilenso.com Nilenso Software (formerly C42 Engineering) -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Core group. To unsubscribe from

Re: [Rails-core] Does *_changed_to?(value) make sense?

2013-12-01 Thread Tejas Dinkar
On 28-Nov-2013, at 7:26 am, Nicholas Firth-McCoy n...@nfm.id.au wrote: p.changed?(name: 'Nicholas') = true If this is happening, it might be nice to test on both the old and the new value p.changed?(name: {“Nick” = “Nicholas”}) -- Tejas Dinkar http://www.nilenso.com Nilenso Software (formerly

Re: [Rails-core] Does *_changed_to?(value) make sense?

2013-12-01 Thread Tejas Dinkar
I’ve created a pull request to make this happen. https://github.com/rails/rails/pull/13131 model.name_changed?(Ringo) model.name_changed?(John = Ringo) On 02-Dec-2013, at 9:04 am, Tejas Dinkar tejasdin...@gmail.com wrote: On 28-Nov-2013, at 7:26 am, Nicholas Firth-McCoy n...@nfm.id.au wrote

Re: [Rails-core] STI and routes

2013-10-09 Thread Tejas Dinkar
On 09-Oct-2013, at 4:17 PM, Ryan Bigg radarliste...@gmail.com wrote: link_to posts, [student.becomes(User), :posts] :-( I don't find this very Object Oriented. It actually builds a User Object, so methods on Student will not work. Also it's bound to be forgotten form_for

Re: [Rails-core] Array.unwrap

2013-09-05 Thread Tejas Dinkar
' if length 1 first end end and so we used to get the only element out of arrays that way. Having an array in which you are sure there is only a single element is something that many would call a smell. However, I think this is off topic for Rails core now. -- Tejas Dinkar http

Re: [Rails-core] Why last doesn't return an ActiveRecord::Relation

2013-07-19 Thread Tejas Dinkar
On Jul-19-2013, at 8:08 PM, Mohamed Wael Khobalatte wael.khobala...@gmail.com wrote: Because you won't need to run a query on one element? I think the question is more about Model.last(5) or Model.first(5) These return arrays when they could return a relation. -- Tejas Dinkar http

Re: [Rails-core] Allow the controller to override the asset_host

2013-03-26 Thread Tejas Dinkar
it significantly more difficult to have different CDN per route, especially if some CDN is not available to some route. -- Tejas Dinkar http://c42.in C42 Engineering - The team behind RubyMonk -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Core group

Re: [Rails-core] Should ActiveRecord::RecordNotSaved attach the record in question?

2013-03-07 Thread Tejas Dinkar
the exception if you want to abort. [1] http://c2.com/cgi/wiki?DontUseExceptionsForFlowControl -- Tejas Dinkar http://c42.in C42 Engineering - The guys behind RubyMonk -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Core group. To unsubscribe from

Re: [Rails-core] Dynamic bang finders in Rails 4

2013-03-06 Thread Tejas Dinkar
together (especially when using scopes), so it makes sense to raise the exception only when I actually try to fetch the record from the database. -- Tejas Dinkar http://c42.in C42 Engineering - The guys behind RubyMonk -- You received this message because you are subscribed to the Google Groups