gonzalo-bulnes/chilean_cities — pull request #10 by juliogarciag (2014-05-20 16:13:29+00:00)
Title: Chore add rails 4 support fix

Hi, thanks for your job. I asked myself the pull request for add rails 4 support was not merged yet into master, so i just used the `chore-add-rails-4-support` branch in my project. I found that the seeds was not well generated for rails 4. The problem is that the seed file (seeds/comunas.rb) was using something like this:

```ruby
ChileanCities::Comuna.find_or_create_by_name(name: "Camarones", code: "15102", provincia: "Arica", region: "Arica y Parinacota", region_number: "XV")
```

In rails 4, `find_or_create_by_name` is not supported anymore, so the correct form for Rails 4 in actually something like this:

```ruby
ChileanCities::Comuna.find_or_create_by(name: "Camarones") { |comuna| comuna.assign_attributes(code: "15102", provincia: "Arica", region: "Arica y Parinacota", region_number: "XV") }
```

Because to change all the calls seems like a lot of work, it just reimplemented `find_or_create_by_name` when that method is not yet implemented (eg: Rails 4) using the new way.