Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Rails Gem that provides subscription functionality
Ruby
branch: master

added expire, expired?, in_the_future? and unexpired scope to the mod…

…el; Added expiry methods to models that include subly
latest commit 87b68ab49f
@fuelxc fuelxc authored
Failed to load latest commit information.
lib added expire, expired?, in_the_future? and unexpired scope to the mod…
spec added expire, expired?, in_the_future? and unexpired scope to the mod…
.gitignore Intial commit
.rvmrc
Gemfile Intial commit
LICENSE.txt
README.rdoc
Rakefile Intial commit
subly.gemspec Added active? for sublies, fixed tests

README.rdoc

Subly

This gem provides the ability to add subscriptions to models that is controlled from an external app

Usage

subly accepts a single optional parameter of :is_methods

class Item < ActiveRecord::Base
  subly :is_methods => [:premium, :standard]
end

Migration

See the last todo, this needs to me a generator/rake task but I am tired and want to goto sleep

create_table :subly_models do |t|
  t.string    :subscriber_type
  t.integer   :subscriber_id
  t.string    :name
  t.string    :value
  t.datetime  :starts_at
  t.datetime  :ends_at
end
add_index :subly_models, [:subscriber_type,:subscriber_id], :name => 'subscriber_idx'
add_index :subly_models, :starts_at, :name => 'starts_idx'
add_index :subly_models, :ends_at, :name => 'ends_idx'

Todo

  • maybe add a controller

  • do something with the value field, I think it useful but can't think of a use case yet.

  • make the doco usefull

  • make a generator for rails 2 and 3

Copyright

Copyright © 2011 SmashTank Apps, LLC. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.