ruby rails and sightseeing

Another excellent Edublogs.org weblog

Eisbären kuscheln mit Huskies

Januar 25, 2010 by · No Comments · Uncategorized

Süßes Video.  Huskies treffen auf Eisbären und kuscheln! Einfach im Hundefutter-Blog ansehen!

Tags: ····

Natursteinteppich im Radladen

Januar 23, 2010 by · No Comments · sightseeing

Hatte heute leichte Probleme mit meinem Fahrrad. Die Kette von meinem Rad(italienisches Fabrikat ^^) war nach dem massiven Streueinsatz der letzten Tage einfach fest/ angerostet. Nun gut, ab zum Fahrradladen und neue Kette sowie  Öl für die weiteren Anbauteile gekauft. Was mir aber echt ins Auge stach. Mein Fahrradhändler hat seinen Fußboden erneuert.  Hat sich doch glatt einen Natursteinteppich verlegen lassen. Natürlich auch noch mit einem Ornament(Wirtschaftskrise^^) . Schicke Sache! Kurze Info: Der Natursteinteppich ist Kieselsteinbelag auf Epoxidharzbasis. Naja, die Reisebiene mag den Bodenbelag scheinbar auch.

Sehenswürdigkeiten in Trier

September 8, 2009 by · No Comments · sightseeing

Das römische Trier hat zusammen mit vielen weiteren Bauwerken, welche 1986 zum Weltkulturerbe erklärt worden, viele Sehenswürdigkeiten. Wer Lust auf ein Wochenende in Trier hat, hier ein paar Sehenswürdigkeiten aus der Antike.

Tags: ·····

has_finder bzw. jetzt named_scope

Mai 11, 2009 by · 1 Comment · Ruby

Meine Lieblingsplugin has_finder ist ja jetzt fester Bestandteil von ActiveRecord. Neuer Name: named_scope

Beispiel mit der opengeodb:


# == Schema Information
# Schema version: 20090410083430
#
# Table name: geodb_tree
#
#  loc_id :integer(4)      not null
#  lft    :integer(4)      not null
#  rgt    :integer(4)      not null
#  level  :integer(1)      not null
#

class Tree < ActiveRecord::Base
set_table_name "geodb_tree"
#klassische Variante
  def self.bundeslaender
    Tree.find(:all,:select=>["g2.loc_id,g2.level, gt.text_val "],:from=>["geodb_textdata AS gt,geodb_tree AS g,geodb_tree AS g2"],:conditions=>["g.loc_id =105 AND g2.lft > g.lft AND g2.rgt < g.rgt AND g2.level = 3 AND gt.loc_id = g2.loc_id AND gt.text_type = 500100000 and valid_until>NOW() and text_locale=?","de"])
  end
#jetzt als has_finder
named_scope :bl ,:select=>["g2.loc_id,g2.level, gt.text_val "],:from=>["geodb_textdata AS gt,geodb_tree AS g,geodb_tree AS g2"],:conditions=>["g.loc_id =105 AND g2.lft > g.lft AND g2.rgt < g.rgt AND g2.level = 3 AND gt.loc_id = g2.loc_id AND gt.text_type = 500100000 and valid_until>NOW() and text_locale=?","de"]
end

Okay, ist nix besonderes. Wir können aber auch kombinieren.
Anderes Beispiel:


class City < ActiveRecord::Base
named_scope :public ,:conditions => {:public => true}
named_scope :city, :conditions => {:loc_level => 6}
end
Aufruf:
>> City.public
>> City.public.city
>> City.public.city.find(:first)

Viel Spaß!

Weiter Links zum Thema:

What’s New in Edge Rails: Has Finder Functionality

[Edge Rails] More on named_scope

Plugins I’ve Known and Loved #2: has_finder

Tags: ···

Bankleitzahlen und Kontonummern mit Ruby überprüfen

Mai 11, 2009 by · No Comments · Ruby

Auf cadego gibt es ein schönes Beispiel ( Bankleitzahlen und Kontonummern ) , wie man Ruby und C kombinieren kann.

Tags: ·····

Hello world!

Mai 11, 2009 by · No Comments · Uncategorized

Welcome to your brand new blog at Edublogs.

To get started, simply log in, edit or delete this post and check out all the other options available to you.

Also, please consider becoming an Edublogs Supporter – you can remove ads from yours and other blogs, upload up to 5GB or audio, video and every other sort of content and access great features under your ‘Plugins’ menu.

Supporters are what keeps Edublogs running and providing free blogs for education, so give it a go today :)

For assistance, take time to view our some helpful introductory videos, read through our Frequently Asked Questions (FAQ) or stop by The Edublogs Forums to chat with other edubloggers.

You can also subscribe to our brilliant free publication, The Edublogger, which is jammed with helpful tips, ideas and more.

And finally, if you like Edublogs but want to be able to simply create, administer, control and manage hundreds of student and teacher blogs at your school or college, check out Edublogs Campus… it’s like Edublogs in a box, all for you.

Thanks again for signing up with Edublogs!