similar to: [ActiveSupport] Add a "remaining_to" method to date class

Displaying 20 results from an estimated 200 matches similar to: "[ActiveSupport] Add a "remaining_to" method to date class"

2012 Nov 10
6
Suggestion: `before_save on: :create` should either work or raise an exception
There''s a small inconsistency in ActiveRecord''s callback syntax that has tripped me up before. It wouldn''t be a big deal, but it can lead to a silent failure. I''d like to suggest that it either be made consistent or be made to fail loudly. The issue is that to do something before validating, but only when creating, you use `before_validation on: :create`,
2012 Oct 18
3
#asset_url helper method
Just putting this out there before I make a pull request. Is there any interest in an asset_url method as a view helper? It would work by using the config.action_controller.asset_host if it exists and prepending this to the results of asset_path. I have found this necessary when writing html emails and needing a full url path for assets. Since my CDN in the asset_host mirrors my assets in my
2012 Nov 15
2
Suggestion: use `select` values if `pluck` called with no args
I suggest that if you don''t pass any args to ActiveRecord#pluck, it would use the select values. This follows along well with the way other AR::Calculations work. As an extra benefit we would be able to pluck virtual columns. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit
2013 Nov 14
6
validates :boolean_field, presence: true misconceptions
Last night a friend of mine started ranting about validates_presence_of :boolean_field returning not valid when the boolean field is false. I checked the rails issues and this seems to be a pretty common concern about the naming of ''presence'' . Instead of changing the behaviour of the presence validator, I was wondering if maybe the answer to avoid such misconceptions could be
2012 Jul 09
10
attr_accessible on some properties + attr_protected on others makes class 'open-by-default'
(I posted this as a bug in GitHub (https://github.com/rails/rails/issues/7018), but then someone there told me I should post it here, so here it is.) If you set attr_accessible on some properties in an ActiveRecord-descended class, and then attr_protected on others - the class becomes ''default-open'' - if any properties are missed or added later, they will be accessible by
2007 Jun 15
4
Environment reuse
All, I''ve run into a few cases recently where I have environments that are nearly (or totally) identical, except for the database. For example, I have a "live" environment locally where I pull production data for load testing or triage, and I generally want it to behave like "development". Similar situations occur for continuous-integration or staging boxen that
2012 Dec 14
1
Re: Digest for rubyonrails-core@googlegroups.com - 4 Messages in 3 Topics
This is a delivery failure notification message indicating that an email you sent could not be delivered. The problem appears to be : -- Recipient email server rejected the message This condition occurred after 1 attempt(s) to deliver over a period of 0 hour(s). If you sent the email to multiple recipients, you will receive one of these messages for each one which failed delivery, otherwise
2013 Jul 22
1
Dependency upon raised error/exception messages.
Hey everyone, first of all, thank you for the tremendous work and effort on making Rails more awesome every day. I''ve brought up this "issue" on Github last Friday. [1] Steve Klabnik told me to bring the discussion here, as it''s more appropriate. The thing is, there is some amount of logic scattered around Rails (and its tests) that depends upon error/exception
2013 Jul 10
4
Decoupling of ActionPack
Hello! Are the plans of splitting ActionPack for several gems (AbstractController, ActionView, etc)? Like https://github.com/rails/rails/pull/7356 ... I.e. I know gems that are needed AbstractController only... And they are forced to require the whole ActionPack... Thanx. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To
2007 Mar 06
15
mocking missing methods
Hi folks. So I''m using mocha on a ruby project, and I really like it. One thing I''ve noticed is that it can be a bit "surprising" when I''m mocking methods that don''t exist on an object, and I think there''s an easyish fix. At the moment, you use sheep = mock() to create a mock sheep. What I''d like to do is something like sheep =
2008 Dec 20
9
Upgrade to Rails 2 - problem with "save" (MySQL boolean issue?)
I have been working through an upgrade of my 1.2.6 application to 2.2.2. I am almost there but I have hit a problem with ActiveRecord. Before the upgrade, the following code was working fine. def create_root(administrator) root = create_root_collection(self.pingee_name, administrator,
2010 Aug 13
4
Rails and Oracle - can select date but cannot save
I''m seeing a behavior in Rails that I find very strange. Having worked quite a bit with Oracle with other languages I would always dutifully do ALTER SESSION SET NLS_DATE_FORMAT = <my_date_format> and ensure I use that date format in my application. With Rails I still have not figured out how to execute an ALTER SESSION statement after connecting to the database (I''m using
2014 Mar 11
0
Rails 4.0.4.rc1 has been released!
Hi everyone, I am happy to announce that Rails 4.0.4.rc1 has been released. This is a bug fix release and includes more than 290 commits. If no regressions are found we will release 4.0.4 final this Friday, on March 14, 2014. If you find one, please open an Issue on GitHub and mention me (@rafaelfranca) on it, so that we can fix it before the final release. ## CHANGES since 4.0.3 To view the
2013 Oct 17
0
Rails 4.0.1.rc1 has been released!
Hi everyone, I am happy to announce that Rails 4.0.1.rc1 has been released. This is a bug fix release and includes more than 450 commits. This release comes up with an important change on how Active Record handles subsequent `order` calls. In Rails 4.0.0 when you do something like this: ```ruby User.order("name asc").order("created_at desc") ``` The later called `order`
2007 Jan 08
2
ActiveSupport Dependency
Hi, Just wondering if ActiveSupport is actually used heavily by Camping when ActiveRecord is not used? I see ActiveSupport is a dependency of ActiveRecord, but Camping still wants it even when ActiveRecord isn''t used.
2006 Jul 30
0
Rails installation problem - activesupport
I am trying to install Ruby on Rails on my G5 PowerPC, I followed <a href="http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger">these</a> instructions. Everything seems to be working fine until i try to install Rails with Rubygems, then I get the following error-message: <blockquote>Install required dependency activesupport? [Yn] y ERROR:
2006 Apr 10
0
Plugins & ActiveSupport::CoreExtensions
Is it possible to add to ActiveSupport''s CoreExtension module via a plugin? The only way I''ve been able to do this is to add my extensions to a library stored in the lib folder. Thanks. -- DeLynn Berry delynn@gmail.com http://www.delynnberry.com
2006 Mar 31
0
can activesupport gem be used in "standalone" fashion?
i''m using ruby 1.8.2, rubygem 0.8.10, rails 1.0.0 where activesupport version = 1.2.5 when i try to run this in RADRail, i get a NoMethodError: require ''rubygems'' require_gem "activesupport" print Time.now + 2.days the error message is: c:/e312workspace/first/test3.rb:5: undefined method `days'' for 2:Fixnum (NoMethodError) is there a way to use
2009 Apr 15
1
uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
I''m on debian etch w/ ruby1.8, activesupport-2.3.2, getting this on the first line of code which is require ''active_support'' : /var/lib/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError) from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require''
2012 Oct 25
0
[Rails 3.2.8] ActiveSupport::BufferedLogger extension, undefined_method
I tried to extend it , with this class , loaded at config time : config.autoload_paths += Dir["#{config.root}/lib", "#{config.root}/lib/**/", "#{config.root}/app/inputs"] lib/extension.rb class ActiveSupport::BufferedLogger def detailed_error(e) error(e.message) e.backtrace.each{|line| error line } end end but calling it in my controller rescue