These are chat archives for rails-sqlserver/activerecord-sqlserver-adapter

28th
Jan 2015
Sean Griffin
@sgrif
Jan 28 2015 03:06
PR that you might be interested in: rails/rails#18706
Ken Collins
@metaskills
Jan 28 2015 12:49
Morning!
Ken Collins
@metaskills
Jan 28 2015 13:18
I like your implementation. Nothing constructive to add that no one else has alrady.
Ken Collins
@metaskills
Jan 28 2015 13:32
Doing some bikeshed’s now. Starting with #2 Rails 4.2
FYI, I was running 4.2 very early one in my play test app. https://homemarks.com
Ken Collins
@metaskills
Jan 28 2015 14:04
I like this pod cast.
Ken Collins
@metaskills
Jan 28 2015 14:30
Codeing this up now… def visit_Distinct_One_As_One_Is_So_Not_Fetch
Ken Collins
@metaskills
Jan 28 2015 15:24
rails-sqlserver/activerecord-sqlserver-adapter@8abb18a
Sean Griffin
@sgrif
Jan 28 2015 16:03
Rofl
Ken Collins
@metaskills
Jan 28 2015 16:04
I’m taking this as far as I can.
Sean Griffin
@sgrif
Jan 28 2015 16:05
Would it make sense for us to have an Arel::Nodes::OneAsOne so that you can handle it in the adapter that way, instead of having to look at the projections?
Or rather so the SQLServer Visitor can handle it
Ken Collins
@metaskills
Jan 28 2015 16:06
Maybe. Or a method vs a constant string.
If the string was not a constant and people did not use dual DBs, I would nave done a #replace on it.
But either way, I would have had to change the context of my select manager rendering.
Sean Griffin
@sgrif
Jan 28 2015 16:06
Right
Ken Collins
@metaskills
Jan 28 2015 16:07
SQL Server is different than most DBs and limit/offset only happens in context of an order.
Sean Griffin
@sgrif
Jan 28 2015 16:07
The only reason I would go with a node over a method is just for consistency with other things that need to change by adapter
Isn't that true elsewhere, as well? Just the order is able to be implicit?
Ken Collins
@metaskills
Jan 28 2015 16:07
Your call. I always feel like I am going to have to hack. But that could just be my old habits with the adapter.
Yes… but if explicit as it has to be on our end, we get errors.
Sean Griffin
@sgrif
Jan 28 2015 16:08
Like I said, I'm hoping to get to the point where the adapters can be on public API in 5.0
Ken Collins
@metaskills
Jan 28 2015 16:08
Heck yes.
I think this adapter is on tract to meet that now that we have at least moved to a more ANSI standard SQL usuage.
If FETCH did not happen, we would still not likely be able to use.
Sean Griffin
@sgrif
Jan 28 2015 16:18
Sure.
Ken Collins
@metaskills
Jan 28 2015 17:12
It is like the stars lined up. You’ve exposed great interfaces and we finally get to use them. Win win.
I'm tempted to spend some time trying to remove all uses of callbacks internally, and seeing what the code looks like.
Ken Collins
@metaskills
Jan 28 2015 20:12
Wow...
FWIW, I never ever ever used accepts_nested_attributes_for or even an explicit auto save.
Sean Griffin
@sgrif
Jan 28 2015 20:12
Yeah, same here
They're both code smells
Ken Collins
@metaskills
Jan 28 2015 20:12
I might be in the shallow end of use cases, but they always seemed like anti-patterns to me and their rent was too high.
Sean Griffin
@sgrif
Jan 28 2015 20:13
Yeah, we're hopefully going to deprecate accepts_nested_attributes_for when we introduce form objects in Rails 5.
Ken Collins
@metaskills
Jan 28 2015 20:13
BTW, working on adding foreign_keys(table_name) now.
I just took a stance against outter describe today.
Sean Griffin
@sgrif
Jan 28 2015 20:15
I think I'm missing why it's not recommended?
Ken Collins
@metaskills
Jan 28 2015 20:32
The point of the gem is to provide spec dsl and assertions within Rails tests cases only. It is a big point of confusion with may people that have no idea that outter describe is just sublassing and looking up the name.
They put things in different folder, etc and it just becomes a mess. I never wanted to supper the spec lookup class anyway. Much prefer the explicit built-in Ruby subclass and just use spec on the inside.
Recent user today told me that bit about RSpec too.
Sean Griffin
@sgrif
Jan 28 2015 21:36
I didn't realize the outer describe had any impact on the class name in RSpec. I thought it was pseudo-random
Granted, I don't think I really ever write tests that fall into any of those buckets. I have no clue what features model tests provide, but I don't use them AFAIK, as I treat them like normal unit tests. Everything else ends up as just a unit test, or a capybara integration test
Ken Collins
@metaskills
Jan 28 2015 21:39
I do too.
Sean Griffin
@sgrif
Jan 28 2015 23:22
Man I really wish I could make it so the schema detection just called attribute for you
But users will expect to be able to use this API to override the schema detected types, without turning off schema detection. :\