Re: [Rails-core] Why locales are not in assets?

2012-04-04 Thread Carlos Antonio da Silva
This library does exactly what you're talking about here: https://github.com/fnando/i18n-js It's a small library to provide the I18n translations on the Javascript. It comes with Rails support. It is for sure worth to take a look. -- At. Carlos Antonio On Wednesday, April 4, 2012 at 5:05 P

Re: [Rails-core] Original MySQL Adapter

2012-05-18 Thread Carlos Antonio da Silva
Hey Erich, there's a discussion on this here: https://github.com/rails/rails/pull/6030, you can add any comment there if you want. Thanks! -- At. Carlos Antonio On Thursday, May 17, 2012 at 9:38 AM, Erich Menge wrote: > Just curious, is there a reason the original MySQL adapter gem is > stil

Re: [Rails-core] Having 2 ActiveRecord test failures on master: "Errors running test_postgresql" using pg 9.1

2012-05-21 Thread Carlos Antonio da Silva
Hey Steve, I just want to add a comment that this is the first failing build with this particular problem: http://travis-ci.org/#!/rails/rails/builds/1391490. From here you can see the commit. It's also worth mention that if you're working on any other change, you can send it as a separate pu

Re: [Rails-core] Transaction during all migrations instead of each migrations

2012-06-18 Thread Carlos Antonio da Silva
Hello guys, just want to add that a new pull request was made adding this feature for supported databases: https://github.com/rails/rails/pull/6768 Please feel free to comment there. Cheers. On Fri, Jun 1, 2012 at 3:58 PM, Rodrigo Rosenfeld Rosas wrote: > Em 01-06-2012 15:56, Gabriel Sobrinho e

Re: [Rails-core] Re: Transaction during all migrations instead of each migrations

2012-06-19 Thread Carlos Antonio da Silva
Hey Simon, thanks for your comments. Would you mind "copying & pasting" them to the issue I linked before? This way others can see it there while checking the related pull request, to decide whether or not the feature should be in. Thanks! -- At. Carlos Antonio On Tuesday, June 19, 2012 at

Re: [Rails-core] custom validations only if all attributes are valid

2012-06-21 Thread Carlos Antonio da Silva
I agree with Steve, when we call valid?, we expect all validations to run. If you want to skip some validation in case errors already exist in the object for any particular reason, you can always to that as you said: `if errors.empty?`. This will give you the behavior you expect, although I'd re

Re: [Rails-core] ActiveModel::Serializers::JSON support arbitrary keys

2012-06-21 Thread Carlos Antonio da Silva
Just linking the related discussion on issues tracker: https://github.com/rails/rails/issues/6811 -- At. Carlos Antonio On Thursday, June 21, 2012 at 11:22 AM, Pier-Olivier Thibault wrote: > > Is there a reason why AM:S doesn't support arbitrary keys to serialization? I > can see a lot of u

Re: [Rails-core] Rails production load order giving uninitialized constant (NameError)

2012-06-21 Thread Carlos Antonio da Silva
Perhaps you'd like to try the Ruby on Rails: Talk mailing list instead, for general questions and help. The Core list is meant to discuss new features and changes in Rails. Thanks. -- At. Carlos Antonio On Thursday, June 21, 2012 at 5:16 PM, A L wrote: > Hi, > > I have a related but separat

Re: [Rails-core] ActiveModel::Serializers::JSON support roles

2012-06-21 Thread Carlos Antonio da Silva
Steve, are you thinking about something like this in terms of code? render json: SearchClient.new(@clients) #or render json: ContractWon.new(@clients) class SearchClient def initialize(clients) @clients = clients end def to_json(options=nil) @clients.to_json(only: %w(foo bar)

Re: [Rails-core] Sorry to be a pest, but -- pull request nag: 6654, PostgreSQL auto-reconnect fix

2012-06-23 Thread Carlos Antonio da Silva
Hello Steve, thanks for keeping your pull request updated. I'll try to ping Aaron to review your pull request as soon as I get a change. Regards. -- At. Carlos Antonio On Saturday, June 23, 2012 at 1:03 AM, Steve Jorgensen wrote: > So that I can know there is test coverage on this in the Rail

Re: [Rails-core] Yet another pull request nag for 6654 -- postgresql-auto-reconnect-2

2012-07-02 Thread Carlos Antonio da Silva
Just commented on the issue, thanks. -- At. Carlos Antonio On Monday, July 2, 2012 at 8:48 PM, Steve Jorgensen wrote: > ... to fix a problem with PostgreSQL reconnect after connection loss & put > test coverage in place to keep it working in the future. > -- > You received this message becau

Re: [Rails-core] Looking for feedback on a change to ActiveModel

2012-07-28 Thread Carlos Antonio da Silva
I'd say it's unnecessary cluttering to the API, and could collide with someone using `model_name` in any sort of model already out there. I think you may be overlooking the way to create your "super simple object", probably one of these two would work quite fine: Class.new(OpenStruct) do

Re: [Rails-core] Could requirement for _attributes suffix for association names in mass assignment security and model data go away in Rails 4?

2012-08-14 Thread Carlos Antonio da Silva
As an addition, accepts_nested_attributes is a feature *meant* for associations, whereas mass assignment helpers - attr_accessible and friends - are not. I don't think it's that worth to change it in a way to check for associations when they're called for each attribute, that'd be a lot of effort f

Re: [Rails-core] Re: Feature feedback before working and pull request please..

2012-09-07 Thread Carlos Antonio da Silva
I believe you should be able to achieve the same just by overriding the #user method in your class. I've commented on your last gist example with an example code to make things more clear. On Fri, Sep 7, 2012 at 2:28 PM, Joe Ferris wrote: > This looks useful to me. If you did implement this, it

Re: [Rails-core] Suggestion: render filters

2012-09-07 Thread Carlos Antonio da Silva
Please show any real use case where this will be useful, to make things more clear. Otherwise it's just hard to figure it out examples where it's useful or not. Thanks. On Wed, Sep 5, 2012 at 3:53 PM, Alexander Kurakin wrote: > Will not be useful functionality similar > https://github.com/shell/

Re: [Rails-core] datetime_select - change order of time and date

2012-09-08 Thread Carlos Antonio da Silva
Yeah, I think it's fine to merge it in as long as we have some code to look at :) On Fri, Sep 7, 2012 at 2:31 PM, Godfrey Chan wrote: > For something like this you might want to just do it and send a PR, it > sounds pretty reasonable so I don't think you'll have much trouble getting > it merged

Re: [Rails-core] [Proposal] Team issuebusters

2012-09-11 Thread Carlos Antonio da Silva
We have done a lot of work on the issues this year, and we were able to bring the number down to almost a half - it was over 800 - and we didn't even know about what happened at RailsConf. The problem is that now it's getting harder to bring this number down. Going through old and stale tickets

Re: [Rails-core] [Proposal] Team issuebusters

2012-09-11 Thread Carlos Antonio da Silva
Ok, Rafael has just listed everything a lot better than I did :) On Tue, Sep 11, 2012 at 1:07 PM, Carlos Antonio da Silva < carlosantoniodasi...@gmail.com> wrote: > We have done a lot of work on the issues this year, and we were able to > bring the number down to almost a half - it

Re: [Rails-core] Re: [ANN] Rails 3.2.9.rc1 has been released

2012-10-31 Thread Carlos Antonio da Silva
Hello, the pull request has been merged and will be in 3.2.9, thanks! On Wed, Oct 31, 2012 at 8:18 AM, Aliaksandr Rahalevich wrote: > Hi here. I have one failed spec in my application and it's caused by return > value from ActiveRecord#update_column method. It looks like this method is > broken t

Re: [Rails-core] has_secure_password

2012-11-28 Thread Carlos Antonio da Silva
min_cost doesn't need to be deprecated, since it was just added to master. I think it's fine for it to be a cost number, similar to devise, though, but others might have different opinions on that. On Wed, Nov 28, 2012 at 8:29 PM, Robert Evans wrote: > devise -- At. Carlos Antonio -- You r

Re: [Rails-core] Re: Deferrable constraints in Migrations DSL

2012-11-29 Thread Carlos Antonio da Silva
Gary, I'd say never, most of the core prefer not to :) On Thu, Nov 29, 2012 at 8:42 PM, Gary Weaver wrote: > And, just for record, I don't like Cucumber ;) >> > > I didn't like it either, but these guys make it look easy, at least to me > :) : https://github.com/gregbell/active_admin/tree/maste

Re: [Rails-core] content_tag_for for combining more AR instances

2013-01-06 Thread Carlos Antonio da Silva
This behavior was added recently and it's meant to render a collection of records, so I don't think it's worth changing it. But, as you can see here: https://github.com/rails/rails/blob/master/actionpack/lib/action_view/helpers/record_tag_helper.rb#L81, you can add a third argument that's the "pref

Re: [Rails-core] Docrails Git Workflow

2013-01-07 Thread Carlos Antonio da Silva
Separate repo here as well. On Mon, Jan 7, 2013 at 5:50 PM, Gosha Arinich wrote: > I have always cloned it separately as well. > > Cheers, > Gosha Arinich > > On Monday, January 7, 2013 at 10:45 PM, James Gifford wrote: > > I have always cloned docrails separately. > > -- > James Gifford > 2162

Re: [Rails-core] Re: ActiveRecord::Persistence.increment! requires a row lock to ensure isolated updates

2013-01-22 Thread Carlos Antonio da Silva
I may be wrong but that's my understanding: #increment happens at instance level, so it takes into account the current value at that particular instance, whereas .update_counters is just a straight sql query, so it can operate using column + value directly. If you want to allow the database to dete

Re: [Rails-core] ActiveRecord::Persistence.increment! requires a row lock to ensure isolated updates

2013-01-23 Thread Carlos Antonio da Silva
> > If this is indeed your use case, what I'm advocating here is much > simpler than that. I just want to be able to increment numeric columns > in active record without declaring them as counter cache columns. You should still be able to do that by calling increment_counter or update_counte

Re: [Rails-core] ActiveModel ::Errors

2013-01-30 Thread Carlos Antonio da Silva
How about: [:start, :stop].each { |attr| errors.add(a,"date must be") } It seems good enough to me, without the need of new APIs. Wdyt? On Wed, Jan 30, 2013 at 2:16 PM, angelo capilleri wrote: > I want made a PR to get the possibility to add more attribute for > errors.add method: > > E

Re: [Rails-core] Re: Model generator: Invoke active_record only 1x for mulitiple models?

2013-02-23 Thread Carlos Antonio da Silva
Yes, zeus is a nice one to speed up development lifecycle. There's also spring , a new tool from jonleighton that's under test and is likely to be the default integration with Rails as part of the development process, I recommend you guys to take a look. Pete,

Re: [Rails-core] Re: Model generator: Invoke active_record only 1x for mulitiple models?

2013-02-24 Thread Carlos Antonio da Silva
ooking forward to seeing that in Rails! > > > On Saturday, February 23, 2013 11:30:57 PM UTC+1, Carlos Antonio da Silva > wrote: > >> Yes, zeus is a nice one to speed up development lifecycle. There's also >> spring <http://github.com/jonleighton/spring>, a n

Re: [Rails-core] Re: Home page route instead of root?

2013-03-11 Thread Carlos Antonio da Silva
Another point to take into account is that the "root" route can be used for any namespace, which is the "root" for that particular namespace. With no namespace, it's the "root" page, ou home page as you say. On Mon, Mar 11, 2013 at 1:54 PM, Richard Schneeman < richard.schnee...@gmail.com> wrote:

Re: [Rails-core] Is this a bug in Rails? undefined method `change' for Infinity:Float (NoMethodError)

2013-03-12 Thread Carlos Antonio da Silva
Alright, great to know that was fixed in 3.2.13.rc :). I'll check what we can do regarding i18n. Thanks! On Tue, Mar 12, 2013 at 6:00 PM, byrnejb wrote: > > > On Tuesday, 12 March 2013 16:40:23 UTC-4, Carlos Antonio da Silva wrote: > >> There was a problem with i18n vers

Re: [Rails-core] Counter Cache Improvements

2013-04-02 Thread Carlos Antonio da Silva
Hello Andy, thanks for you your interesting in contributing to Rails, we're very happy about that! :) Regarding your questions: 1) I think this has been implemented by this commit: https://github.com/rails/rails/commit/455d710242f24f0cfff89f626164493276e0f3e9, so we have one man down ;). 2) I'd

Re: [Rails-core] Re: false.present? is false. Is it desired behaviour?

2013-06-27 Thread Carlos Antonio da Silva
As you can see here: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/blank.rb#L55, blank? is also implemented in FalseClass to always return true, so yes, it was deliberate :) On Thu, Jun 27, 2013 at 8:17 AM, Amitav Mohanty wrote: > Hey > > On Wed, Jun

Re: [Rails-core] couldn't find file 'jquery.ui.all'

2013-06-29 Thread Carlos Antonio da Silva
jquery-rails 3.0+ has removed jquery-ui as you can see in the changelog. There's a jquery-ui-rails I think, check the readme for more info. (and be aware of what Steve has commented ;) On Sat, Jun 29, 2013 at 9:36 AM

Re: [Rails-core] small extension to link_to_if

2013-12-17 Thread Carlos Antonio da Silva
You can already achieve basically the same functionality with Ruby and conditional modifiers: <%= link_to an_url,.. do %> Menu Label for admin <% end if user_role.admin? %> <%= link_to an_url,.. do %> Menu Label for user <% end if user_role.user? %> <%= link_to an_url,.. do %> Menu Label f

Re: [Rails-core] single quotes for controller generated routes

2014-01-13 Thread Carlos Antonio da Silva
No reason as far as I am aware of, in general Rails uses single quotes for generated controller views where it doesn't need double quotes, so I think it's ok changing the generated controller route too. Please make sure to review the documentation and guides looking to fix examples too, if you dec

Re: [Rails-core] rails 4.1 unable to get all enum types

2014-02-05 Thread Carlos Antonio da Silva
This is available on master only, not on the released beta version. I think you have the constant User::USERTYPES available, the implementation changed afterwards. Also, please use the Rails Talk or stack overflow for questions, this list is mainly for feature discussions. Thanks! On Wed, Feb 5,

Re: [Rails-core] rails issue #13854

2014-02-14 Thread Carlos Antonio da Silva
In general we only backport issues to 4-0-stable, not to 3-2 anymore. If it hasn't been backported to 4-0 yet, you can ask in the issue for someone to backport it (it seems a simple fix so it's probably ok to backport). Hope that clarifies it :) On Fri, Feb 14, 2014 at 5:15 PM, nardele salomon w

Re: [Rails-core] Rails 4.1

2014-02-25 Thread Carlos Antonio da Silva
Hello Sergio, the rc1 is out, and basecamp is running 4.1 in production for some time already, so you should definitely start your new project with it! :) There might be a new rc in the upcoming days depending on the regressions we find, and then the final version coming after that (assuming no m

Re: [Rails-core] how adding a "version" when generating a new rails project

2014-03-03 Thread Carlos Antonio da Silva
Indeed I don't think there's need to track "versions" on a web application, since it's way more common for people to use tags or similar with git or some other scm, when they do. In any case, it's fairly easy to add that to your application if you want or need it: *module Todo* * class Applicati

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

2014-03-05 Thread Carlos Antonio da Silva
Or wrap with (): *link_to(post.title, post, class: ["post", ("active" if post.active?)])* On Wed, Mar 5, 2014 at 2:47 PM, Nicolás Sanguinetti < h...@nicolassanguinetti.info> wrote: > Sorry, it should be ["post", post.active? && "active"] > > > On Wed, Mar 5, 2014 at 3:23 PM, Stefan Schüßler

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

2014-06-18 Thread Carlos Antonio da Silva
+1 from my side, never seen a use case for *_path on mailers. On Wed, Jun 18, 2014 at 12:47 PM, Xavier Noria wrote: > On Wed, Jun 18, 2014 at 5:45 PM, richard schneeman < > richard.schnee...@gmail.com> wrote: > > If we go down this route, the error message should be crystal clear: >> >> "The me

Re: [Rails-core] strong parameters safety issue enables accidental mass assignment

2014-08-06 Thread Carlos Antonio da Silva
Generally speaking I believe developers should be careful/responsible for handling what they are sending to their models for mass assignment, and there's where strong params help. The ideal solution indeed would be for Parameters not to inherit from Hash, which is something Rails will likely be cha

Re: [Rails-core] Re: reality of fixtures as a default?

2014-08-06 Thread Carlos Antonio da Silva
We have been using fixtures lately in some projects at Plataformatec and it's been work great. The ability to have a pre-defined set of fixtures and modify them for each test works very well for most of our scenarios, and when it does not or it gets a little complex we build helpers to generate th

Re: [Rails-core] Feature idea: ActiveRecord::Relation.size always returns an integer

2014-09-11 Thread Carlos Antonio da Silva
size in this case is an pretty much an "alias" for count, thus it's gonna work the same way as count when grouping. Is there any particular reason to know how many records returned if you are grouping? On Wed, Sep 10, 2014 at 11:16 AM, Shinohara Teruki wrote: > ActiveRecord::Relation.size retur

Re: [Rails-core] Validation the presence of an ActiveRecord belongs_to association should imply a valid associated object?

2014-09-11 Thread Carlos Antonio da Silva
Well, the presence validation does exactly what it says, no matter which type of attribute we're talking about. For example, it doesn't work with booleans because it'd never allow `false` to be saved. To actually validate that the associated object is valid itself, you should add the association v

Re: [Rails-core] Feature idea: ActiveRecord::Relation.size always returns an integer

2014-09-12 Thread Carlos Antonio da Silva
That's why I said that In this specific case it was like an "alias", not exactly an alias. Count will always query the DB anyway, but let's hear more thoughts on this one. Carlos Antonio da Silva - via celular On Sep 11, 2014 11:54 PM, "Shinohara Teruki" wrote:

Re: [Rails-core] Feature idea: remove internal from form_for, form_tag and button_to

2014-09-21 Thread Carlos Antonio da Silva
I believe this has been added to Rails 4.2/master already: https://github.com/rails/rails/commit/89ff1f82f01bd70e12ec1b45049be30ac262df30 Cheers. On Sun, Sep 21, 2014 at 7:48 PM, Claudio B. wrote: > Hello Rails team, and thanks for your amazing work! > > I would like to create a Pull Request so

Re: [Rails-core] Feature idea: remove internal from form_for, form_tag and button_to

2014-09-22 Thread Carlos Antonio da Silva
ion accordingly: > http://github.com/rails/rails/pull/17001 > > Thanks > > On Sunday, September 21, 2014 3:56:18 PM UTC-7, Carlos Antonio da Silva > wrote: >> >> I believe this has been added to Rails 4.2/master already: >> https://github.com/rails/rails/commit/89ff1f82

Re: [Rails-core] Using "rescue_from Exception" to render a 500 page with the application layout will not catch all Exceptions

2014-10-08 Thread Carlos Antonio da Silva
I don't know if rescue_from Exception should catch everything as you expect, what I do know is that you can use the router to point to a normal controller / action(s) and use any layout you want for that. Check this post at Plataformatec's blog: http://blog.plataformatec.com.br/2012/01/my-five-fav

Re: [Rails-core] ActionMailer deliver_later and i18n in 4.2

2014-10-22 Thread Carlos Antonio da Silva
You should probably be passing in the locale you want as an argument to your mailers, and set the locale there before actually creating the mail object/rendering the view. On Wed, Oct 22, 2014 at 1:07 PM, Mohamed Wael Khobalatte < wael.khobala...@gmail.com> wrote: > There shouldn't be any problem

Re: [Rails-core] ActionMailer deliver_later and i18n in 4.2

2014-10-23 Thread Carlos Antonio da Silva
tioned or solved as I see. > > среда, 22 октября 2014 г., 23:12:24 UTC+8 пользователь Carlos Antonio da > Silva написал: >> >> You should probably be passing in the locale you want as an argument to >> your mailers, and set the locale there before actually creating th

Re: [Rails-core] t(".key") convenience pollutes global i18n namespace

2014-11-06 Thread Carlos Antonio da Silva
I think it's fine adding a default namespace for such lookups, it should be preferred over the non-namespaced version (eg in docs and everywhere), but I don't think we need to actually break existing functionality. We could just add this and leave the existing one in place as a fallback, or deprec

Re: [Rails-core] Method to find inside of relation

2014-11-14 Thread Carlos Antonio da Silva
You should be able to use find_by and pass in a hash with attributes and respective values to find a record. Please take a look at the docs for find_by on the api guides. Carlos Antonio da Silva - via celular On Nov 14, 2014 7:44 PM, "Sunny Juneja" wrote: > Hey, I ran into this p

Re: [Rails-core] Attributes escaping not following SGML

2014-11-28 Thread Carlos Antonio da Silva
Which Rails version? Just ran the exact same code in 4.0.11 & 4.1.17 and got this: >> include ActionView::Helpers::TagHelper > => Object > >> tag 'input', value: 'abc "dsfa"' > => "" 2014-11-28 13:18 GMT-02:00 Bráulio Bhavamitra : > Hello all, > > On rails console: > > include ActionView::Help

Re: [Rails-core] Method for combining :if and :unless on validates when nesting with_options

2014-12-05 Thread Carlos Antonio da Silva
I think you can also combine multiple conditions with an array of methods to be called: *with_options if: [:something?, :something_else?] do* *...* *end* It's a bit simpler/cleaner than the block form, but I don't think that works in a nested way as you are imagining (and I think it might be bett

Re: [Rails-core] Find an ActiveRecord::Error in an object by attribute name and error type.

2014-12-05 Thread Carlos Antonio da Silva
You should be able to use the *#added? * method for this. Hope that helps. On Fri, Dec 5, 2014 at 5:54 PM, Daniel Gomez Sierra < danielgomezsie...@gmail.com> wrote: > Is there a way to know if a record has an error wit

Re: [Rails-core] Specifying controller action for an action in a route definition

2014-12-08 Thread Carlos Antonio da Silva
As far as I remember, you should use the *controller* option to point the resource to a specific controller. And if you need to customize each action, maybe you're not creating a resource at all, maybe you need to review what *resource(s) *you are working with. Hope that helps :) On Sat, Dec 6, 2

Re: [Rails-core] Inconsistent file name suffix on mailer generator

2014-12-16 Thread Carlos Antonio da Silva
I don't particularly see any problem on adding the mailer suffix to the generated file, and in fact Rails 5 might be the best release for doing so. On Tue, Dec 16, 2014 at 7:23 PM, Carlos Souza wrote: > > Is there a reason why mailers created through generators don't have a > "_mailer" suffix ? >

Re: [Rails-core] Generating ActiveRecord model table name to include namespace

2015-02-01 Thread Carlos Antonio da Silva
Not sure I get what's the actual difference between a new option like that and setting the table name prefix on the module, which will work for all classes under it? Can you expand on that a bit? On Sat, Jan 31, 2015 at 4:52 AM, Matthew Dunbar wrote: > I will implement this myself, looking for f

Re: [Rails-core] Generating ActiveRecord model table name to include namespace

2015-02-03 Thread Carlos Antonio da Silva
e module name, > rather than setting it with the existing method. Then eventually this feels > like a sensible default to me. > > On Sunday, February 1, 2015 at 7:39:58 AM UTC-5, Carlos Antonio da Silva > wrote: >> >> Not sure I get what's the actual difference between a

Re: [Rails-core] Rails GSOC

2015-03-03 Thread Carlos Antonio da Silva
Hello Sushruth, glad to hear you're interested in applying for GSoC to work on Ruby on Rails, we have a wiki page with a few ideas , but you can also propose one of yours in case you have something interesting for the framework. The best place t

Re: [Rails-core] options_for_select with hash

2015-04-01 Thread Carlos Antonio da Silva
This caught me once or twice as well, until I got used to it, but I think it's a rather complex change to do as there seems to be no way of deprecating it, it'll likely break every single app out there that uses selects, so I'd rather keep it as is for now. On Wed, Apr 1, 2015 at 6:10 AM, printerc

Re: [Rails-core] I18n Relative Time - DateHelpers with Prefixes/Suffixes

2015-07-13 Thread Carlos Antonio da Silva
Wouldn't that work with a translation of your own, that receives the "time ago" as an argument that you can interpolate, like this: *translate :time_ago, time: time_ago_in_words(Time.current)* *# locale* *en:* * time_ago: "%{time} ago"* *pt-BR:* * time_ago: "%{time} atrás"* *zomg:* * time_a

Re: [Rails-core] Nokogiri adds a lot of weight to ActionView

2015-07-13 Thread Carlos Antonio da Silva
As a side note, the base functionality of the number helpers was moved to Active Support , so you don't need to rely on Action View anymore in this scenario. (I understand the concern about including nokogiri, just wanted to make

Re: [Rails-core] Please fix the links in the Rails README.md on github.

2015-08-17 Thread Carlos Antonio da Silva
Can you be more clear on what the issue is with the links, and what you expected? On Fri, Aug 14, 2015 at 10:49 AM, Douglas Allen wrote: > I have some work to do for my repo now because of this. > Here is what I have for the first page. > https://github.com/DouglasAllen/rails-v4.2.3-starter/blob

Re: [Rails-core] Authentication Token vs Bearer token

2015-09-03 Thread Carlos Antonio da Silva
This has been merged to Rails master: https://github.com/rails/rails/pull/19094, so it should be out with Rails 5. On Tue, Sep 1, 2015 at 2:59 PM, Yordis Prieto wrote: > I am trying to use ActionController::HttpAuthentication::Token and the > header for get the toke have to be Authenticate Token

Re: [Rails-core] Re: Arguments to rails update rake task

2015-09-03 Thread Carlos Antonio da Silva
Makes sense to me, happy to see a pull request with such change. On Thu, Sep 3, 2015 at 10:42 AM, siva subrahmanyam < subbu9848155...@gmail.com> wrote: > > Hi All > > Could you share your thoughts? > > > On Thursday, 27 August 2015 20:49:26 UTC+5:30, siva subrahmanyam wrote: >> >> >> Hi All >> >

Re: [Rails-core] Errors inside custom setters

2015-09-10 Thread Carlos Antonio da Silva
Hi, is there any reason why you could not move the validation to a proper validation "callback" so that it'd work like any other validation does? I mean, if you know the value is wrong in the moment you're setting, you could allow it to be set and validate the same afterwards, but there's probably

Re: [Rails-core] Errors inside custom setters

2015-09-10 Thread Carlos Antonio da Silva
y > def xml=(string) > xml_doc = Nokogiri::XML(string) { |config| config.noblanks.strict } > # more code here > rescue Nokogiri::XML::SyntaxError => error > self.errors.add(:xml, error.message) > end > > def xml > # some code here, effectively to_xm

Re: [Rails-core] Class list helper for HTML tags

2015-09-21 Thread Carlos Antonio da Silva
Hi Philippe, you should be able to use Rails' ability to pass in an array of classes, and Ruby's parentheses to create a scope, to handle this scenario for you: *<%= content_tag_for :tr, @model, class: ['foo', ('ready' if @model.ready?)] do %>* That should give you the same html response you exp

Re: [Rails-core] update_attributes save only if columns changed?

2015-10-02 Thread Carlos Antonio da Silva
Save should already work with partial updates enabled, which means it won't trigger an actual update on the database unless something has changed, so there should be no need to check at this point. Hope that helps. On Fri, Oct 2, 2015 at 2:12 AM, Sean Teeling wrote: > Is there a reason why call

Re: [Rails-core] Appending multiple line numbers to run multiple tests

2015-12-05 Thread Carlos Antonio da Silva
I don't remember using that feature of rspec personally, but I see how it can be useful, so I'd say to try out a PR with the change :) Carlos Antonio da Silva - via celular On Dec 5, 2015 2:00 PM, "siva subrahmanyam" wrote: > In rspec we can run multiple specs as rspec sp