Hi, On Fri, Apr 20, 2012 at 11:13 AM, Dmytrii Nagirniak <[email protected]>wrote:
> On 19/04/2012, at 3:27 PM, Craig Read wrote: > > But the fact that it breaks default functionality (and the developers > response) scares me. > > What do you mean by "developers response"? >> > > I was referring to Ernie's response to the issue you raised, and his > response to the related issue: https://github.com/ernie/squeel/issues/67 > > His responses seem to indicate he (thinks he) knows better about how the > Rails core internals should work. > He also cited the lack of documentation as a justification: "In AR > documentation, symbols are never shown as a value in examples." > > As pcantrell noted: "Call it questionable or not, but squeel is explicitly > *narrowing* the set of valid inputs on existing ActiveRecord methods. > That is a Bad Thing™". > > > Ohh, yeah. I think the use of symbols is the biggest controversy in > Squeel. Interestingly enough pcantrell later agrees with Ernie: > https://github.com/ernie/squeel/issues/67#issuecomment-2274798 > Your intransigence about this suddenly makes a lot more sense! > I hadn't read that far through the whole thread. But I do see the trade-off Ernie had to make. > I use symbols in queries extensively and don't like to be forced into > String. > But apart from that I just dropped Squell into the app and everything just > worked. I only had to change Symbols to Strings in a couple of places. > Much of my system is also using symbols. Even if it's "undocumented", I have seen symbols used in examples in a number of books. Including "The Rails 3 Way" and "Rails Recipes" (from a quick search through my e-books). But it's probably a case of YMMV. This is what the author replied in a tweet: >> https://twitter.com/erniemiller/status/192082433540231168 >> "FWIW, it's much less intrusive than MetaWhere was, and it saw tons of >> use." >> > > He can interperet the intentions of the Rails core devs (based on their > docs or not), or justify his code by comparing it to other Gems as much as > he likes. But unless he's prepared to convice the core team that his way > is better, I think he should "go with the flow", or at least avoid breaking > their code. > > That makes sense. But it seems the only real concern here is the use of > symbols that is sacrificed in favour of another "feature". > If that was the only concern, then I wouldn't consider it much of an issue. I think the concern about breaking a wider set of Gems that may also require that functionality is a bigger concern. I do still like the look of squeel, but that concern is a big one. I know > I'd have to change code to make my projects work. > > It does raise the question of how many Gems are out there that would cause > Rails to fail its test suite though. > And personally, that'd be the most comprehensive test of "sociability" you > easily could do for any gem. > If you can't install your gem without causing the Rails test suite to > fail, I'd consider that "A Bad Thing". > > > Hmm, how how is it possible to run Rails test suite with Squeel installed? > I'm making an assumption here, because I haven't personally tried it. Might give it a go on the weekend. Download the rails source, run their tests, install the Gem (or make AR depend on it), run the tests again and check for any difference in the results. If that functionality isn't covered by the rails tests, then I'd consider it fairly strong indication that the functionality was a "side effect" of what they intended, rather than what they actually intended. Are you saying that you personally wouldn't use squeel in production? > Consultant's answer: It depends. I'd spike the change and see exactly what breaks. If it broke the functionality of any other gems used in the system, I'd back away slowly. If not, I'd give it a go. If it can be verified that the gem doesn't break the Rails tests, I'd feel much more confident though. Cheers, -- Craig Read @Catharz https://github.com/Catharz http://stackoverflow.com/users/158893/catharz -- You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en.
