Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use ActiveModel instead of the activerecord-tableless gem #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.textile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
h1. CHANGELOG

h3. 2.0.3 July 7, 2014 (book version unreleased)
h3. 2.1.0 unreleased (book version 2.1.0)

* updated Ruby from version 2.1.1 to 2.1.2
* updated Rails from version 4.1.1 to Rails 4.1.4
* updated Rails from version 4.1.1 to Rails 4.1.5
* use ActiveModel instead of the activerecord-tableless gem

h3. 2.0.2 May 5, 2014 (book version 2.0.2)

Expand Down
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'
ruby '2.1.2'
gem 'rails', '4.1.4'
gem 'rails', '4.1.5'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
Expand All @@ -9,7 +9,6 @@ gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
gem 'activerecord-tableless'
gem 'foundation-rails'
gem 'gibbon'
gem 'google_drive'
Expand Down
62 changes: 30 additions & 32 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.1.4)
actionpack (= 4.1.4)
actionview (= 4.1.4)
actionmailer (4.1.5)
actionpack (= 4.1.5)
actionview (= 4.1.5)
mail (~> 2.5.4)
actionpack (4.1.4)
actionview (= 4.1.4)
activesupport (= 4.1.4)
actionpack (4.1.5)
actionview (= 4.1.5)
activesupport (= 4.1.5)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
actionview (4.1.4)
activesupport (= 4.1.4)
actionview (4.1.5)
activesupport (= 4.1.5)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.4)
activesupport (= 4.1.4)
activemodel (4.1.5)
activesupport (= 4.1.5)
builder (~> 3.1)
activerecord (4.1.4)
activemodel (= 4.1.4)
activesupport (= 4.1.4)
activerecord (4.1.5)
activemodel (= 4.1.5)
activesupport (= 4.1.5)
arel (~> 5.0.0)
activerecord-tableless (1.3.4)
activerecord (>= 2.3.0)
activesupport (4.1.4)
activesupport (4.1.5)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
arel (5.0.1.20140414130214)
better_errors (1.1.0)
better_errors (2.0.0)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
rack (>= 0.9.0)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
builder (3.2.2)
Expand All @@ -51,7 +50,7 @@ GEM
execjs (2.2.1)
faraday (0.9.0)
multipart-post (>= 1.2, < 3)
foundation-rails (5.3.3.0)
foundation-rails (5.4.1.0)
railties (>= 3.1.0)
sass (>= 3.2.0)
gibbon (1.1.3)
Expand Down Expand Up @@ -100,25 +99,25 @@ GEM
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.1.4)
actionmailer (= 4.1.4)
actionpack (= 4.1.4)
actionview (= 4.1.4)
activemodel (= 4.1.4)
activerecord (= 4.1.4)
activesupport (= 4.1.4)
rails (4.1.5)
actionmailer (= 4.1.5)
actionpack (= 4.1.5)
actionview (= 4.1.5)
activemodel (= 4.1.5)
activerecord (= 4.1.5)
activesupport (= 4.1.5)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.4)
railties (= 4.1.5)
sprockets-rails (~> 2.0)
rails_12factor (0.0.2)
rails_serve_static_assets
rails_stdout_logging
rails_layout (1.0.21)
rails_serve_static_assets (0.0.2)
rails_stdout_logging (0.0.3)
railties (4.1.4)
actionpack (= 4.1.4)
activesupport (= 4.1.4)
railties (4.1.5)
actionpack (= 4.1.5)
activesupport (= 4.1.5)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.3.2)
Expand Down Expand Up @@ -157,7 +156,7 @@ GEM
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (2.2.2)
turbolinks (2.3.0)
coffee-rails
tzinfo (1.2.2)
thread_safe (~> 0.1)
Expand All @@ -169,7 +168,6 @@ PLATFORMS
ruby

DEPENDENCIES
activerecord-tableless
better_errors
binding_of_caller
coffee-rails (~> 4.0.0)
Expand All @@ -181,7 +179,7 @@ DEPENDENCIES
jquery-rails
pg
quiet_assets
rails (= 4.1.4)
rails (= 4.1.5)
rails_12factor
rails_layout
sass-rails (~> 4.0.3)
Expand Down
11 changes: 5 additions & 6 deletions app/models/contact.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
class Contact < ActiveRecord::Base
has_no_table

column :name, :string
column :email, :string
column :content, :string
class Contact
include ActiveModel::Model
attr_accessor :name, :string
attr_accessor :email, :string
attr_accessor :content, :string

validates_presence_of :name
validates_presence_of :email
Expand Down
6 changes: 3 additions & 3 deletions app/models/visitor.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Visitor < ActiveRecord::Base
has_no_table
column :email, :string
class Visitor
include ActiveModel::Model
attr_accessor :email, :string
validates_presence_of :email
validates_format_of :email, :with => /\A[-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}\z/i

Expand Down