Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DataMapper 2 Lightening Talk

Lucas Dohmen
November 18, 2012

DataMapper 2 Lightening Talk

Unfortunately, Piotr Solnica couldn't make it to the conference. I really would have liked to see it and meet him, so this inspired me to give this little talk :)

Lucas Dohmen

November 18, 2012
Tweet

More Decks by Lucas Dohmen

Other Decks in Programming

Transcript

  1. RWTH Aachen, Computer Science Student triAGENS GmbH, Developer moon lum

    moonbeamlabs by Lucas Dohmen DataMapper 2 and you What you can do today
  2. class User include DataMapper::Model attribute :id, Integer attribute :name, String

    attribute :age, Integer attribute :phone, Array[PhoneNumber] end https:// ithub.com/solnic/virtus
  3. https:// ithub.com/emmanuel/aequitas class User # Define all the attributes... #

    ...with Virtus ;) # Validate with Aequitas: validates_presence_of :name validates_numericalness_of :age validates_format_of :email, :as => :email_address end
  4. https:// ithub.com/dkubb/veritas require 'veritas' new_relation = relation.project([ :name, :age ])

    new_relation = relation.rename(name: :full_name) natural_join = one_relation + another_relation union = one_relation | another_relation
  5. # Define a mapper DataMapper.generate_mapper_for(User) do key :id map :name,

    :to => :username end # Search for data DataMapper[User].all DataMapper[User].order(:age) DataMapper[User].find(age: 23) https:// ithub.com/solnic/dm-mapper