Blog

Showing posts with label stand-up. Show all posts
Showing posts with label stand-up. Show all posts

Thursday, September 30, 2010

SearchLogic ordering not working: Uses associations default scope for ordering

Came across an interesting issue with Searchlogic. Given the following models:

class Organization < ActiveRecord::Base
  has_many :contacts
  default_scope :order => "name"
end

class Contact < ActiveRecord::Base
  belongs_to :association
end

Contact.search(:first_name_or_last_name_or_assocation_name => "Nicholas", :order => "descend_by_last_name")

The search will actually use the Organization default scope to order the search, i.e. by organization's "name", not contact's "last_name". The fix, unfortunately remove the default scope from the Organization class.

This appears to be an issue with ActiveRecord, not Searchlogic.

Friday, September 10, 2010

Autospec problem, autospec exiting without results

A little frustration today with autospec (to clarify, not autospec's fault). I had recently installed RVM and started using gemsets (really this is amazing). When setting a default gemset I installed a bunch of gems including Paperclip 2.3.3. Unfortunately, Paperclip's dependencies include ActiveSupport and installed version 3.0.0. My current default gemspec is setup for rails 2.3.8, I have built a separate one for Rails 3.0.0 on Ruby 1.9.2. For some reason, with ActiveSupport 3.0.0 installed, caused autospec to exit without any results.

(Not running features.  To run features in autotest, set AUTOFEATURE=true.)
loading autotest/rails_rspec
style: RailsRspec

The solution, simply uninstall ActiveSupport 3.0.0 (and any other 3.0.0 Rails dependencies) Paperclip 2.3.3 runs just fine with 2.3.8. This really makes sense since I want to keep a clean 2.3.x environment. To be clear, I had not installed Rails 3.0.0 in this gemset.

Friday, September 3, 2010

Radiant Releases Now Listed on the Wiki Page

It's now been a week writing my daily stand-up blog posts. I was prefixing the title with "24hrs Firsthand" to identify them as my daily post, but really this seems redundant and just added a lot of noise with no value. After all a blog is a journal, and I suspect readers don't need to know it's my "daily blog post". I will still tag them with stand-up. Now onto some real content...

Radiant Release Notes

Instead of doing my normal wrap-up of yesterday's events, I spent some time this morning listing the Radiant releases on the wiki, with links to release notes, change logs and upgrade notes. I had this in a text file on my local computer -- seemed silly not to share it. I'm sure everybody, new and old to Radiant, will find this very useful.

Thursday, September 2, 2010

Leave a project how you would like to find it

I started a new CMS project yesterday with Radiant. One aspect I am really focusing on is to ensure that all the "other" details are taking care of during the development, so when another developer needs to work on it, they can get started on it as quickly as possible.

The new Bundler and Rails 2.x config.gem have certainly helped with installing dependent gems, but I still think it's beneficial to have a step by step guide in the form of a README file on getting the application running and any other aspects of the application the developer should know about.

GitHub presents the README file of the homepage of the repository.

README file on Github

Please replace the default README file in your Rails or Radiant application (or any other open source application). Here's a basic outline of what you could include:

  • Application setup and database bootstrapping
  • Testing frameworks used and how to run the tests
  • References used on the project (for example, if you used a third-party API, link to those documents)
  • Any other interesting notes that you discovered during development, but would have liked to have known before you got started
  • Populating the database with "demo" data
  • How to easily preview application emails (hint: rake tasks)

Are there any other items that should be in the README? Do you have any links to examples of great README's?

Wednesday, September 1, 2010

Radiant 0.9.1 and Globalize2 Extension

I've started a new project using Radiant. After doing a review of other Ruby on Rails-based CMS projects, Radiant is still my first choice.

This project will be a bi-lingual website and the Globalize2 Extension does a brilliant job of meeting this requirement. You can view the screencast below to get a feel for it's functionality.

However the "master" project repository is not compatible with Radiant 0.9.1. You will need to use this repository instead. I'm thankful for GitHub and forking!

Friday, August 27, 2010

jQuery Cycle Plugin Ghosting with Transparent PNG's in IE

Some one please stop the Internet Explorer madness. I definitely don't want to become the IE go-to-guy. Back to programming Ruby next week, but today was finally getting the jQuery Cycle Plugin working nicely with transparent PNG's.

The issue: IE's handling of transparent PNG's causing ghosting or dark artifacts when animating with the opacity property. It appears I'm not the onlyperson who has come across this problem. So to get IE to play nicely with jQuery Cycle Plugin I need to apply UnitPNGFix to all versions of IE; this hack is typically used for Internet Explorer version 6.x.

This worked well, but I was getting intermittent errors from Cufón when applying the hack:

Attribute only valid on v:image

As suggested by the guys and gals at Media Dog, placing the UnitPNGFix after the Cufón script would resolve the problem. I had no such luck until I explicitly identified which PNG's to "fix" by specifying the classes with "unitPng". Admittedly this what I should have done in the beginning. Once I specified the elements to fix, IE worked flawlessly with the jQuery Plugin.

As a side note, I've never integrated Cufón into a project before. Does it tend to mess up layout in older browsers? When I say older, I mean Internet Explorer. It certainly generates a lot of HTML, and I'm not totally sure if people are aware of the legality converting fonts and having these openly available on the 'Net. Definitely something I need to further investigate.

Thursday, August 26, 2010

IE7 CSS Madness

Inspired by blogs such as Pivotal Labs and Rails Test Prescriptions I am going to attempt to do a daily recap of yesterday's firsthand experiences. These are going to be short, brief posts. I was going to call it simply Standup but I thought it would be nice to tie the company name in. So here it goes:

Internet Explorer 7 CSS Madness

Yesterday I was thrown into cleaning up some front end CSS for IE7 late in the afternoon. Here's some tricks for kids:

  • The drop-down of a select element in HTML does not expand it's width to display the longest option. Fixed using a JQuery plugin ie-select-width. There is also ie-select-style that allows you to style the select element.
  • IE7 does not play nice with transparent PNG's and the  jQuery Cycle plugin. It tends to acquire the background colour of the parent element. The fix is to add "background: none !important" to the element containing the PNG image in the slideshow.

Please note this blog is no longer maintained. Please visit CivilCode Inc - Custom Software Development.