Sudeep Agarwal | 20 May 2013 07:44
Picon
Gravatar

datamapper@... - 1 Message in 1 Topic

I have done this in my spec file:

RSpec.configure do |config|
  config_file = YAML.load_file('settingsyml')['test']
  #DataMapper::Logger.new($stdout, :debug)
  DataMapper.setup(:default, config_file['db_url'])
  DataMapper.finalize
  DataMapper::Model.raise_on_save_failure = true

  #--------------------------------------------------------------------------------------------#
  # Flush all tables before each test and enter some default values #
  #--------------------------------------------------------------------------------------------#
  config.before(:each) {
    DataMapper.auto_migrate!
    # Seed tables here
  }

And this in my Rakefile:

    require 'rspec/core/rake_task'
    RSpec::Core::RakeTask.new(:spec)

So, whenever i do:

    $ rake spec

It automigrates the db and seeds it and executes the specs

On Mon, May 20, 2013 at 3:39 AM,  <datamapper@...> wrote:
>   Today's Topic Summary
(Continue reading)

Akshay Khole | 19 May 2013 07:01
Picon

Datamapper autoupgrade for test db

How can I run an autoupgrade for my test database to contain my schema before running my specs ? 


Currently I do not see a rake task doing that. 

Am I missing something?

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Neil C | 13 May 2013 21:41

Error message: SSL SYSCALL error: Connection timed out

I have a Rails 3.2 application with DataMapper against Postgres that has produced this error: 
Error message: SSL SYSCALL error: Connection timed out 


This seems to be a common problem with ActiveRecord and Postgres as described here: https://github.com/rails/rails/issues/3392

However, I am curious how the DataMapper community believes this can be resolved.

Thanks.

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
draxxxeus | 10 May 2013 08:56
Picon
Gravatar

Facing problem with multiple many-to-many associations

Hi,
I want to implement the following scenario:

One user can be owner of multiple groups
One user can be member of multiple groups
One group can have multiple owners
One group can have multiple users

I have two models, User and Group.
In the user model, when I try to do this:

      User.get(:id => 1).group_owners

I get this error:

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
draxxxeus | 10 May 2013 09:00
Picon
Gravatar

Facing problems with multiple many-to-many relationship, getting '+options[:links]+ should not be empty'

I have the structure described here: http://tny.cz/1cd100f7

Thanks

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Tiago Matos | 7 May 2013 00:57
Gravatar

querying 2 tables on a single DM call

Hello, 

I have a performance related question. 

We have a call which runs multiple times per page load. After reading http://datamapper.org/docs/associations.html we currently have TranslationTarget.first(:translation_key => {:source => source}) but it first does a query to table TranslationKey then the query to TranslationTarget:

DEBUG - (0.000468) SELECT `id` FROM `translation_keys` WHERE (`source` = 'Top Referrers' AND `domain` = 'admin') DEBUG - (0.002409) SELECT `id`, `revision_status`, `revision_account_email`, `locale`, `updated_at`, `translation_key_id`, `account_id` FROM `translation_targets` WHERE (`translation_key_id` = 369 AND `locale` = 'pt' AND `revision_status` = 'approved') ORDER BY `id` LIMIT 1

(domain and revision_status are not very important fields, just filters)

Is there a way to use Datamapper here and avoid direct SQL?

Many thanks in advance.


Tiago Duarte Matos
http://tiagomatos.org

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Sayth Renshaw | 16 Apr 2013 02:51
Picon

Mariadb adapter - MySQl

Simple and short question.

Is it possible to use the MySQL adapter to connect with the MariaDB database? If Yes How?

Thanks

sayth

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Gus Shotz | 4 Apr 2013 02:50
Picon

Writing DM queries using newer 1.9+ symbol format, how?

How would I write zoo.all(:population.gte => 100, :staff.gt => 2) using the newer symbol: format? I was hoping I could do zoo.all(population: >= 100, staff: > 2) but it doesn't work.

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Vanja Radovanović | 30 Mar 2013 02:30
Picon

In memory adapter example for DM2

Hi, I've been trying to setup an in memory adapter example for DM2.

Want to use it in a project, so this is kind of an experiment.

Anyway, I'm having trouble inserting records.
Example code can be found here: https://gist.github.com/elvanja/5228179

The commented out attempt was taken from dm-mapper source, as noted.
And it fails with the described exception.
The currently active attempt does not complain, but the records are not found later in assertion.

With <at> dkubb's help, here are a bit more details that might be helpfull...
The insert method returns PersonMapper instance, for which I'd expect to contain the new record.
Interestingly, <at> mapper.insert(Person.new(id: 1, name: 'Jane')).all returns 2 element array:
["#<Person:0x000000039339d0 <at> id=:id, <at> name=1>", "#<Person:0x00000003813118 <at> id=:name, <at> name="Jane">"]

Any suggestions on how to approach this?

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Abe Voelker | 29 Mar 2013 20:52
Favicon
Gravatar

How to use Postgres' NOTIFY/LISTEN from DataMapper?

I'm trying to take advantage of Postgres' awesome NOTIFY/LISTEN feature to avoid polling a table for changes, but am having trouble trying to figure out how to use them from DataMapper.  With the pg driver you can call wait_for_notify, which blocks until the server sends a NOTIFY response, but how would I execute this from a DataMapper context?


Also, if anyone has any experience with the JDBC driver, is it true that it doesn't support the wait_for_notify type behavior that the pg driver does so I would be unable to avoid polling using JRuby?

Thanks!

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Ari King | 28 Mar 2013 15:08
Picon

How to Manipulate Join Table Data?

Hi,

I just recently started using DM and I'm unclear on how one can/should manipulate data in join tables. Using the photo, tag, tagging example (see below) -- how can I using DM add, change, or delete data from the "tagging" table?

class Photo include DataMapper::Resource property :id, Serial has n, :taggings has n, :tags, :through => :taggings end class Tag include DataMapper::Resource property :id, Serial has n, :taggings has n, :photos, :through => :taggings end class Tagging include DataMapper::Resource belongs_to :tag, :key => true belongs_to :photo, :key => true end

Thanks.

-Ari

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gmane