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

2nd
Feb 2015
Sean Griffin
@sgrif
Feb 02 2015 14:04
No, I didn't take it personally, but it just made me question whether the rest of the articles will be equally boring
Ken Collins
@metaskills
Feb 02 2015 15:21
Morning @sgrif
I’m no blog master. But I struggle with details and the entertainment factor a lot.
Michael Lang
@mwlang
Feb 02 2015 15:22
What's the link to the previous blog posts? I'll give it a read as I'm actually interested in learning Rails internals more.
Ken Collins
@metaskills
Feb 02 2015 15:22
In some of my articles, I start at the end.
That one links to @sgrif’s first one.
(feedback appreciated)
Michael Lang
@mwlang
Feb 02 2015 15:28
Well, I just learned a new Ruby trick...#cover? is a new one for me for checking that values are within a range of values.
Ken Collins
@metaskills
Feb 02 2015 15:29
Aside: I never ready API docs… just the code. For this very reason.
Michael Lang
@mwlang
Feb 02 2015 15:29
One thing missing is before and after...when you asked, "do you see what I see" If I hadn't worked on the mess of code for the 1.15 AR backport, I would've been slightly clueless as to what was improved upon.
I'm the same way. I can figure out from the code how things are supposed to work. The API docs leave too much out or they document some old approaches rather than the current approaches.
Michael Lang
@mwlang
Feb 02 2015 15:43
@sgrif It's a good article and I'd definitely benefit from reading up on the above topics more. It does a give job of introducing new devs to the internal workings and why things are the way they are or were changed.
@sgrif I tried to post a comment next to the "def typecast" code block, but that doesn't seem to be working...the comment I had here was that instead of a large case switch, I think that I would simply implement the pertinent value_to_XXX methods on the string class (or alias existing core implementations) so that I could just do self.class.send("value_to#{type", value).
Michael Lang
@mwlang
Feb 02 2015 15:53
Anyway, just some off the cuff thoughts from a relative new-comer to the AR nitty-gritty world.
Sean Griffin
@sgrif
Feb 02 2015 17:50
@mwlang Yeah, you should almost always use cover? when you know you have a range. include? will use the Enumerable version, which means it'll turn the whole thing into an array.
Which also won't work if you give it any value that doesn't respond to succ
I'm not sure I understand your comment. Just to make sure I'm clear, you're suggesting monkey patching String, etc?
Sean Griffin
@sgrif
Feb 02 2015 17:56
@metaskills What do you think of a method named determine_type_for_column_because_i_super_swear_im_not_working_with_an_active_record_model_and_this_is_the_only_type_information_i_have ?
I could also put raise unless caller.first == "insert_fixture" || caller.first == "ActiveRecord::ModelSchema#load_schema!" :trollface:
determine_type_for_column_even_though_i_probably_should_be_getting_it_from_somewhere_else
Ken Collins
@metaskills
Feb 02 2015 18:33
@sgrif Reading...
Sean Griffin
@sgrif
Feb 02 2015 18:33
It was mostly a joke
Ken Collins
@metaskills
Feb 02 2015 18:34
OMG… and it is so hitting home.
Too bad that can not fit in a tweet!
Sean Griffin
@sgrif
Feb 02 2015 18:34
Ha
Ken Collins
@metaskills
Feb 02 2015 18:34
It can!
Sean Griffin
@sgrif
Feb 02 2015 18:34
I'll probably just call it type_infered_from_schema or something like that, and express my concerns in a comment once again
Though I wonder if I'm just being too defensive about this
Ken Collins
@metaskills
Feb 02 2015 18:34
Hard call.
Sean Griffin
@sgrif
Feb 02 2015 18:34
Especially since I'll probably end up reviewing any commit that would be doing the wrong thing (I hope)
Ken Collins
@metaskills
Feb 02 2015 18:35
You know… I almost finished the new DatabaseTask work in the adapter.
I mean, this is big news! It will mean EVERY GH issue and PR will be closed.
That means, I could spend some time next week exploring these items in tandem with you.
I woul make a 4-2-stable branch and tinker on master.
Another first for the adapter :)
Sean Griffin
@sgrif
Feb 02 2015 18:36
Holy shit I wish I thought we would ever get to that point on rails/rails
Ken Collins
@metaskills
Feb 02 2015 18:36
TBF, your master is the 5-x tinker land :)
Sean Griffin
@sgrif
Feb 02 2015 18:37
I meant 0 open issues/prs
Ken Collins
@metaskills
Feb 02 2015 18:37
OMG!
Yes.
Maybe one day I can join issues group and help out.
Sean Griffin
@sgrif
Feb 02 2015 18:37
Yeah, there's definitely a manpower problem there
There's also just this class of issues which are hard to get rid of
Ken Collins
@metaskills
Feb 02 2015 18:38
Gonna make a mental note to that.
I bet.
The “PDI” ones maybe?
“Please Do Invetigate"
Sean Griffin
@sgrif
Feb 02 2015 18:38
Like the PRs that we don't really want to merge without more changes, but it was a drive by commit and they don't fix feedback, but we don't like closing PRs that would have otherwise been excepted because it can discourage people
Ken Collins
@metaskills
Feb 02 2015 18:38
Yup.
Sean Griffin
@sgrif
Feb 02 2015 18:38
Or the really old bugs that are totally valid but we just have no clue how to fix
Ken Collins
@metaskills
Feb 02 2015 18:39
Neat… I might like to chew on some of those.
Sean Griffin
@sgrif
Feb 02 2015 18:40
Sometimes they actually are possible
I've had one or two where they were actually easy, but nobody had re-evaluated in ~1 year and they were still mostly impossible a year ago
The big dragon that would be great to tackle is having the form builder automatically work if the route is singular instead of plural
Which comes down to having url_for do the right thing when given a model which maps to a singular route.
Which is a performance hotspot
Ken Collins
@metaskills
Feb 02 2015 18:43
Whoa.
I will admit, I am so ActionPack weak.
Sean Griffin
@sgrif
Feb 02 2015 18:44
I am, as well
I've done a few things to that code base
And it was scary
Ken Collins
@metaskills
Feb 02 2015 18:44
We need an ActionPack version of @sgrif
Sean Griffin
@sgrif
Feb 02 2015 18:44
Lol
Well once we finally agree that it's time to deprecate the /:controller/:action legacy routing, we can basically re-design the router, speed everything up, simplify the lookup in both directions, and fix that problem
Ken Collins
@metaskills
Feb 02 2015 21:12
rails-sqlserver/activerecord-sqlserver-adapter@348361d
So not a fan of mocked tests.
The work contributed by others which copied PG’s mock/stubs for these tests would pass and still not work in real life.
Was really easy to just do the real thing.
Sean Griffin
@sgrif
Feb 02 2015 21:13
Which tests?
Ken Collins
@metaskills
Feb 02 2015 21:14
Ours.
Not saying rails/rails is wrong either.
Sean Griffin
@sgrif
Feb 02 2015 21:15
Yup. That test is silly.
Ken Collins
@metaskills
Feb 02 2015 21:15
I like to create solid mini DSLs when testing.
Sean Griffin
@sgrif
Feb 02 2015 21:16
I'm a mockist personally, because it makes it clear what the interface of the collaborators are, and that responsibility x lives on object a and not collaborator b. But that one defintely gains no value from omcking
It can be dangerous though, since it's really easy to hide complex object graphs which are supposed to be giving you feedback on your design
Ken Collins
@metaskills
Feb 02 2015 21:18
Awesome… yea, I found when doing that last work, that I needed to move away from a memoized let to a simple private helper.
Fair point.
Ken Collins
@metaskills
Feb 02 2015 21:38
The fact we now have full database task support is a big deal.
Sean Griffin
@sgrif
Feb 02 2015 21:38
Great job!
Ken Collins
@metaskills
Feb 02 2015 21:38
Now to figure out how to get FreeTDS bins installed for pre compiled windows so they can get in on it.
Sean Griffin
@sgrif
Feb 02 2015 21:39
What's windows? :trollface:
Ken Collins
@metaskills
Feb 02 2015 21:44
LOL
In a way, it is sad that Windows user have gems built for them.
Shields them from the pain and stunts their growth.
Ken Collins
@metaskills
Feb 02 2015 21:49
v4.2.2 is out.
Ken Collins
@metaskills
Feb 02 2015 22:00
OK, signing off. I need a big Schneider-Weisse and I know where to find it.
Sean Griffin
@sgrif
Feb 02 2015 22:01
Peace
Ken Collins
@metaskills
Feb 02 2015 22:01
Thanks Sean! I needed that, been a bad day on the office front.
TTYT man!