Thank you. If I continue using Sequel (and I believe I will) I shall throw
together a beginner's guide once I have reached a greater understanding
On Monday, April 6, 2015 at 3:42:27 PM UTC+1, Erik Griffin wrote:
>
> Hi, I would very much like to begin using Sequel, but I am having some
> trouble getting it to work.
>
> I wanted to make a basic model and run some Rspec tests.
>
> I have a user.rb file which looks like this:
>
> require 'sequel'
>
> class User < Sequel::Model
>
> primary_key :id
> String :name
>
> end
>
> and a test that looks like this:
>
> require 'spec_helper'
>
> describe 'Song' do
>
> let(:song) {Song.new}
>
> end
>
> No tests yet. But I am getting an error because of the line `primary_key
> :id`:
>
> `*<class:User>': wrong number of arguments (1 for 0) (ArgumentError)*`
>
> Removing that line removes the error, but don't all entries need a primary
> key?
>
> Here is my spec_helper file:
>
> ENV['RACK_ENV'] = 'test'
>
> require './server'
> require 'capybara/rspec'
>
> Capybara.app = Server
>
> RSpec.configure do |config|
>
> config.around :each do |example|
> DB.transaction(:rollback=>:always, :auto_savepoint=>true){example.run}
> end
>
> end
>
>
>
> I haven't been able to wrap my head around this ORM yet. I'm using
> Postgres btw. Any help is appreciated
>
>
>
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.