Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rails Gem that provides subscription functionality

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 subly.gemspec
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.