Devchat.tv Episode Roundup

Devchat.tv Episode Roundup

Download on the App Store

All Devchat.tv Episode Roundup episodes

  • Introduction to Sandra: The Cassandra ORM
    When I started playing with Cassandra, I wound up writing part of an ORM to get what I needed from it.
    I want to build actual projects with Rails, Ruby, or other technologies for my videos rather than just narrowly demonstrate a piece of technology. So, I'm bringing you up to speed with Sandra so that as I continue with the Twitter Clone, you'll know what I'm using and why I'm adding things to it.
    Sandra is available on Github at https://github.com/charlesmaxwood/sandra
    Download 531.0 MB
    Download (iPod & iPhone) 111.8 MB
    Take the 2011 Readers Survey
    0 min
  • State of the Podcast – What’s up with Teach Me To Code

    I haven't done a podcast in about 3 weeks. I'm changing some things around and wanted to let you know what they were.

    For this podcast, I plan on foregoing my occasional rants on programming and do interviews every week. If you know someone who I should have on the podcast, then let me know.

    I'm going to change the format of the Screencasts as well. I'm going to move from a library demo meme to actually building web apps from start to finish. I think these tutorials are useful and insightful. It's also a little different from the other things out there.

    RailsRookies.com was launched last week. Right now it's a page listing the courses I'll be teaching over the next few months. If you're interested in those courses or something that isn't up there, then fill me in on what you want. I'd love to provide it for you.

    The Ruby on Rails Basics course starts next week.

    The newsletter is going to be published every other week. I'll try to share some insight from what I'm reading, studying and working on. I hope you enjoy it.

    I'm also trying to figure out who is interested in a Freelancing community centered around Ruby. If you'd like to be involved, contact me.

    Finally, I'm working on some new projects to try to supplement my consulting income. One of them involves Boy Scouts. The other involves online Pay Per Click marketing.

     

    14 min
  • ActiveRecord Observers
    About a month ago, I talked about ActiveRecord Callbacks. Observers are a way of moving callbacks out of the Model. Usually this is done to adhere to the Single Responsibility principle. So, for example, programmers will move sending an email when a record is updated or created to an Observer.
    class UserObserver < ActiveRecord::Observer
    def after_create(user)
    UserMailer.sign_up(user).deliver
    end
    end
     
    Observers should be included in your app/models folder and named using the same convention as your models. So in this case, this observer would be saved to /app/models/user_observer.rb.
    To load the observer in your application, you need to include this line in your config/application.rb
    config.active_record.observers = :user_observer
     
    Finally, you can observe more than one model with the same observer.
    class SignUpObserver < ActiveRecord::Observer
    observer :user, :admin
    def after_create(user)
    UserMailer.sign_up(user).deliver
    end
    end
     
    I personally like Observers when they help keep you from repeating code or increase code readability. In many cases, I simply keep callbacks in models and violate the Single Responsibility Principle.
    8 min
  • ActiveModel – Making Ruby Classes Behave Like Models
    I’ve been working on an ORM for Cassandra. One of the things I’ve been using to build the ORM is ActiveModel. ActiveModel gives you modules you can add to your class that makes it behave like an ActiveRecord Model.
    Here are some of the features you can add to your classes with ActiveModel.
    Attribute Methods
    Callbacks
    Dirty Attributes (knowing which attributes have changed)
    Naming (allows you to reference the class and model by the object)
    Observers
    Serialization (to JSON or XML)
    State Machine (a really basic one)
    Translation
    Validations
    So, if you’re looking to add your Ruby class to a Rails app, or want this sort of behavior in Sinatra, etc. this is a great way to get it.
    7 min
  • Acceptance Testing with Evan Light and Jorge Dias

    Coulda

    Filet
    Test::Unit

    Thoughts on what make good acceptance tests:

    • Don’t write brittle tests
    • Communication between the coder and customer
    • Not being low level
    • Keep them at the same level of abstraction
    • Thoughts on Cucumber:

      • Jorge likes Cucumber’s Given-When-Then
      • Cucumber’s plain english definitions are extra overhead when your customer isn’t going to read your
      • english definitions.
      • Evan likes Cucumber for:
        • Popping the why stack
        • Given When Then And
        • Evan doesn’t like:
          • It’s an external DSL
          • Boundary between the test language and the code
          • Has loose coupling between step definitions
          • We need our acceptance tests to run fast too.

            How do you test your javascript?

            • Selenium tests on the critical parts
            • Ignore the javascript and test the ajax requests.
            • capybara-webkit
            • parallel_tests gem

              Hydra
              jasmine-fixtures

              12 min