Skip to content
Browse files

Renamed to modest_model to prevent conflict with an existing simple_m…

…odel gem
  • Loading branch information...
1 parent 3c0e013 commit d7ae34d73d048c6ec31eaa9c25652a14e8ba8465 Mike Fulcher committed Jul 30, 2011
View
2 Rakefile
@@ -15,7 +15,7 @@ end
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'SimpleModel'
+ rdoc.title = 'ModestModel'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.md')
rdoc.rdoc_files.include('lib/**/*.rb')
View
4 lib/model_model.rb
@@ -0,0 +1,4 @@
+module ModestModel
+ autoload :Base, 'modest_model/base'
+ autoload :Validators, 'modest_model/validators'
+end
View
4 lib/simple_model/base.rb → lib/modest_model/base.rb
@@ -1,12 +1,12 @@
-module SimpleModel
+module ModestModel
class Base
include ActiveModel::Conversion
extend ActiveModel::Naming
extend ActiveModel::Translation
include ActiveModel::Validations
include ActiveModel::AttributeMethods
- include SimpleModel::Validators
+ include ModestModel::Validators
def initialize(attributes = {})
attributes.each do |attr, value|
View
2 lib/simple_model/validators.rb → lib/modest_model/validators.rb
@@ -1,4 +1,4 @@
-module SimpleModel
+module ModestModel
module Validators
class AbsenceValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
View
4 lib/simple_model.rb
@@ -1,4 +0,0 @@
-module SimpleModel
- autoload :Base, 'simple_model/base'
- autoload :Validators, 'simple_model/validators'
-end
View
4 lib/tasks/simple_model_tasks.rake
@@ -1,4 +0,0 @@
-# desc "Explaining what the task does"
-# task :simple_model do
-# # Task goes here
-# end
View
6 simple_model.gemspec → modest_model.gemspec
@@ -1,8 +1,8 @@
Gem::Specification.new do |s|
- s.name = "simple_model"
+ s.name = "modest_model"
s.authors = ["Mike Fulcher"]
- s.summary = "Simple, ActiveModel-compliant models"
- s.description = "Simple, ActiveModel-compliant models. Like Structs, but better!"
+ s.summary = "Simple, tableless ActiveModel-compliant models"
+ s.description = "Simple, tableless ActiveModel-compliant models. Like ActiveRecord models without the database."
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"]
s.test_files = Dir["test/**/*"]
s.version = "0.0.1"
View
2 test/dummy/config/application.rb
@@ -3,7 +3,7 @@
require 'rails/all'
Bundler.require
-require "simple_model"
+require "modest_model"
module Dummy
class Application < Rails::Application
View
2 test/fixtures/sample_model.rb
@@ -1,4 +1,4 @@
-class SampleModel < SimpleModel::Base
+class SampleModel < ModestModel::Base
attributes :name, :email
attributes :nickname
validates :nickname, :absence => true
View
2 test/simple_model_test.rb → test/modest_model_test.rb
@@ -1,7 +1,7 @@
require 'test_helper'
require 'fixtures/sample_model'
-class SimpleModelTest < ActiveSupport::TestCase
+class ModestModelTest < ActiveSupport::TestCase
test "validates absence of nickname" do
sample = SampleModel.new(:nickname => "Spam")
assert !sample.valid?

0 comments on commit d7ae34d

Please sign in to comment.
Something went wrong with that request. Please try again.