<    April 2017    >
Su Mo Tu We Th Fr Sa  
                   1  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
30
00:12 mikeyhew joined
00:14 glennpratt joined
01:01 glennpratt joined
02:24 aidalgol joined
03:44 glennpratt joined
06:08 glennpratt joined
12:21 Guest2181 joined
15:16 glennpratt joined
15:30 <flips> For migrations, naming files 001_create_tables etc, what happens when there's two 001_something files? (Alphabetical/ascii?)
15:43 <Rennex> try it... might produce an error
15:45 <flips> This blog tutorial has me creating another 001_create_posts.rb ... long after the first 001_tables.rb ... should cause trouble ;)
16:11 <flips> Not sure if this belongs in here or #roda, trying to figure out what's nil and what .valid? checks/does: https://gist.github.com/flips/d8d087044eef4e5c31603ccc13147fa3 (pry output)
16:20 <flips> If I read the output correctly, one of these causes the nil error: "Sequel::Model.plugin :validation_helpers", "Sequel::Model.plugin :timestamps, update_on_create: true" <-- both included in my main app.rb just before loading plugins
17:09 <Rennex> flips: $ @post.valid?
17:09 <Rennex> shows the method source
17:10 <Rennex> but that might not get you very far if it calls a bunch of other methods
17:11 <Rennex> flips: but look at the file it's coming from, that respond_to? method... seems like something is calling x.respond_to?(y) where y happens to be nil
17:11 <flips> Still good to know ... the error is realted to adding " Sequel::Model.plugin :timestamps, :update=>:published_at, update_on_create: true" to my app.rb
17:12 <flips> s/realted/related/ :)
17:13 <flips> hence the error: from /Users/flips/.rvm/gems/ruby-2.4.0@Roda/gems/sequel-4.45.0/lib/sequel/plugins/timestamps.rb:96:in `respond_to?'
17:17 <Rennex> yes, but find out what it's feeding to respond_to
17:18 <flips> not sure how to dig deeper ... :)
17:19 <Rennex> start by looking at timestamps.rb line 96...
17:22 <flips> meth = :"#{field}=" ... pasted the 'def set_create_timestamp(time=nil)' lines in the gist
17:24 <Rennex> ok, so model.create_timestamp_field must be returning nil
17:27 <Rennex> flips: try adding :create=>:created_at to the plugin options
17:36 <flips> Same error, but more fields present in @post
17:37 <flips> => #<Post @values={:title=>"Test 1", :content=>" Sequel::Model.plugin :timestamps, :create=>:created_at, :update=>:published_at, update_on_create: true", :user_id=>1}>
17:40 glennpratt joined
17:48 <flips> @post.validate returns => [], not sure if that's relevant ;)
17:49 <flips> In the migration file I have: 'DateTime :created_at, null: false' and 'DateTime :published_at, null: false'
17:52 <adam12> published_at can't have a null false value
17:52 <adam12> Actually
17:52 <adam12> nm, you have update_on_create
17:55 <adam12> I wonder if it's because you're mixing Hash syntax, causing the arity to be off.
17:55 <adam12> Sequel::Model.plugin :timestamps, update: :published_at, update_on_create: true
18:02 <flips> Didn't make much difference. Looking at the @post content I pasted above, it's confusing, because the :content is these code strings, in lack of a lorem ipsum generator ;)
18:16 <adam12> flips: Yeah. Something is busted. Maybe gist your entire Post model file.
19:08 <flips> adam12: https://pastebin.com/dGnBfL13
20:33 ta_ joined
20:56 jaequery joined
21:42 ta_ joined
22:49 ta_ joined
23:40 ta_ joined