RailsCasts Pro episodes are now free!

Learn more or hide this

Bjarki Gudlaugsson's Profile

GitHub User: codehugger

Site: http://blog.codehuggers.com

Comments by Bjarki Gudlaugsson

Avatar

I did a crude fix that seems to work. I basically just required the time_duration library from inside models/episode.rb.

ruby
require 'time_duration'

class Episode < ActiveRecord::Base
  ...
end

Please correct me if this is the wrong approach :)

Avatar

Is anybody else receiving this error?

To replicate you clone the repo for the episode, go into the after folder and run

bundle install
time bundle exec rake spec:models

I am using ruby 1.9.3-p385 and rbenv.

Episode translates single digit seconds into timecode with minutes
     Failure/Error: build(:episode, seconds: 60*8+3).timecode.should eq('8:03')
     NameError:
       uninitialized constant Episode::TimeDuration
     # ./app/models/episode.rb:8:in `duration'
     # ./app/models/episode.rb:5:in `timecode'
     # ./spec/models/episode_spec.rb:19:in `block (2 levels) in <top (required)>'
Avatar

Thanks! I have been looking for something like this.

Avatar

I had the same problem and the solution is basically that you have to enable hstore on the database. Run the following (after you have created the db of course :)

$> psql blog_development

blog_development=# CREATE EXTENSION hstore;

For futher information and how to do this as a rails migration see this

Avatar

I managed to figure it out :)

xml
<fieldType name="text" class="solr.TextField" omitNorms="false">
    <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StandardFilterFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.NGramFilterFactory" minGramSize="1" maxGramSize="15" />
    </analyzer>
    <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StandardFilterFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>
</fieldType>
Avatar

Anybody know how to configure sunspot/solr to imitate textmate's command-t like searches?